Help me guys I got a very weird problem. I don't know how to fix it!
This is shown when I add it to srb2 srb20017.png
And this is how command ends topha2.png
If someone wants to know how is named lump with command script so here it is: LUA_BODY
Help me guys I got a very weird problem. I don't know how to fix it!
This is shown when I add it to srb2 srb20017.png
And this is how command ends topha2.png
If someone wants to know how is named lump with command script so here it is: LUA_BODY
Amateur of wading,drawing and Match
Why do you have */ there? That's to mark the end of a comment. Lua lumps have to have a LUA_ prefix as well, and having three lines of code doesn't really help.
Originally Posted by SRB2Originally Posted by Steam
I mean I have LUA_BODY not LUMP_BODY sorry for fail
- - - - - - - - - -
Okay so i gonna delete it now
- - - - - - - - - -
Oh i don't see your post in my first custom command help topic and that you said there it solved the problem ^_^
- - - - - - - - - -
Okay this don't help because it says "WARNING: RusssianHat.wad| LUA_BODY: 80: unexpected symbol near ')'
Amateur of wading,drawing and Match
Can you post the full Lua code? I don't know how to fix it unless if you show it.
Originally Posted by SRB2Originally Posted by Steam
okay you should got on pv hatsandcapsbeta.wad
Amateur of wading,drawing and Match
...what? I don't understand.
Can you post the full Lua code here?
Originally Posted by SRB2Originally Posted by Steam
Okay here's the code:
COM_AddCommand("rushat", function(player)
if player.mo
freeslot(
"S_RUSHATFOLLOW1",
"S_RUSHATFOLLOW2",
"S_RUSHATFOLLOW3",
"S_RUSHATFOLLOW4",
"S_RUSHATFOLLOW5",
"S_RUSHATFOLLOW6",
"MT_RUAHAT")
//normal height characters
states[S_RUSHATFOLLOW1] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*33, FRACUNIT*-7, S_RUSHATFOLLOW1}
states[S_RUSHATFOLLOW2] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*23, FRACUNIT*-7, S_RUSHATFOLLOW2}
//short characters
states[S_RUSHATFOLLOW3] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*26, FRACUNIT*-7, S_RUSHATFOLLOW3}
states[S_RUSHATFOLLOW4] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*22, FRACUNIT*-7, S_RUSHATFOLLOW4}
//Crawla Honcho and Robo Hood need a taller following hat that doesent adjust for spin
states[S_RUSHATFOLLOW5] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*38, FRACUNIT*-7, S_RUSHATFOLLOW5}
//Eggman needs and even TALLER following hat! With no spin adjust, of course
states[S_RUSHATFOLLOW6] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*64, FRACUNIT*-7, S_RUSHATFOLLOW6}
addHook("ThinkFrame", do
for player in players.iterate
if player.mo
and not (player.pflags & PF_NIGHTSMODE)
if player.health and not player.mo.hat
player.mo.hat = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z+player.mo.height, MT_RUSHAT)
player.mo.hat.target = player.mo
end
end
end
end)
addHook("ThinkFrame", do
for player in players.iterate
if player.health and player.mo.hat
//this adjusts the hat when in any spin state
if (player.pflags & PF_JUMPED)
or (player.pflags & PF_MACESPIN)
or (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
or (player.pflags & PF_STARTDASH)
or (player.pflags & PF_SPINNING)
then
P_SetMobjStateNF(player.mo.hat, S_TOPHATFOLLOW2)
else
P_SetMobjStateNF(player.mo.hat, S_TOPHATFOLLOW1)
end
end
if player.health and player.mo.hat
and (player.mo.skin == "tails")
or (player.mo.skin == "cream")
//the shorter characters need a shorter hat adjust
if (player.pflags & PF_JUMPED)
or (player.pflags & PF_MACESPIN)
or (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
or (player.pflags & PF_STARTDASH)
or (player.pflags & PF_SPINNING)
then
P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW4)
else
P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW3)
end
end
if player.health and player.mo.hat
and (player.mo.skin == "crawlahoncho") or (player.mo.skin == "robo-hood")
//Crawla Honcho and Robo Hood hat adjust, no spin adjust
P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW5)
end
if player.health and player.mo.hat
and (player.mo.skin == "eggman")
//Eggman follow adjust, no spin adjust
P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW6)
end
end)
Amateur of wading,drawing and Match
I'm no Lua expert, but would you need a closing parenthesis here?
Originally Posted by Xkower8181
You had quite a few gaping holes in your code. There were many ends missing, and you needed to add a hook to some of the code. There was also a few misspellings...like MT_RUAHAT and S_TOPHAT (which in your case had to be S_RUSHAT).
Fixed code:
Code:freeslot( "S_RUSHATFOLLOW1", "S_RUSHATFOLLOW2", "S_RUSHATFOLLOW3", "S_RUSHATFOLLOW4", "S_RUSHATFOLLOW5", "S_RUSHATFOLLOW6", "MT_RUSHAT") //normal height characters states[S_RUSHATFOLLOW1] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*33, FRACUNIT*-7, S_RUSHATFOLLOW1} states[S_RUSHATFOLLOW2] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*23, FRACUNIT*-7, S_RUSHATFOLLOW2} //short characters states[S_RUSHATFOLLOW3] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*26, FRACUNIT*-7, S_RUSHATFOLLOW3} states[S_RUSHATFOLLOW4] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*22, FRACUNIT*-7, S_RUSHATFOLLOW4} //Crawla Honcho and Robo Hood need a taller following hat that doesent adjust for spin states[S_RUSHATFOLLOW5] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*38, FRACUNIT*-7, S_RUSHATFOLLOW5} //Eggman needs and even TALLER following hat! With no spin adjust, of course states[S_RUSHATFOLLOW6] = {SPR_RUSH, 0, 1, A_CapeChase, FRACUNIT*64, FRACUNIT*-7, S_RUSHATFOLLOW6} COM_AddCommand("rushat", function(player) if player.mo addHook("ThinkFrame", do for player in players.iterate if player.mo and not (player.pflags & PF_NIGHTSMODE) if player.health and not player.mo.hat player.mo.hat = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z+player.mo.height, MT_RUSHAT) player.mo.hat.target = player.mo end end end end) addHook("ThinkFrame", do for player in players.iterate if player.health and player.mo.hat //this adjusts the hat when in any spin state if (player.pflags & PF_JUMPED) or (player.pflags & PF_MACESPIN) or (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT) or (player.pflags & PF_STARTDASH) or (player.pflags & PF_SPINNING) P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW2) else P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW1) end end end end) addHook("ThinkFrame", do if player.health and player.mo.hat and (player.mo.skin == "tails") or (player.mo.skin == "cream") //the shorter characters need a shorter hat adjust if (player.pflags & PF_JUMPED) or (player.pflags & PF_MACESPIN) or (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT) or (player.pflags & PF_STARTDASH) or (player.pflags & PF_SPINNING) P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW4) else P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW3) end end end) addHook("ThinkFrame", do if player.health and player.mo.hat and (player.mo.skin == "crawlahoncho") or (player.mo.skin == "robo-hood") //Crawla Honcho and Robo Hood hat adjust, no spin adjust P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW5) end end) addHook("ThinkFrame", do if player.health and player.mo.hat and (player.mo.skin == "eggman") //Eggman follow adjust, no spin adjust P_SetMobjStateNF(player.mo.hat, S_RUSHATFOLLOW6) end end) end end)
Originally Posted by SRB2Originally Posted by Steam
Still WARNING: RusssianHat.wad| LUA_BODY: 80: unexpected symbol near ')'
Amateur of wading,drawing and Match