Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Weird problem with command's end

  1. #1
    Join Date
    April 19th, 2014
    Location
    Poland
    Posts
    211
    Level
    36

    Weird problem with command's end

    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

  2. #2
    Join Date
    March 25th, 2010
    Posts
    1,442
    Level
    58
    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.
    Quote Originally Posted by SRB2
    <Mystyc Cheez> I ****ING QUIT
    Mystyc Cheez left the game
    <~Sky> Am I too awesome or something?
    <X\Wind> Why is everyone on red...
    <X\Wind> Is Sky that awesome?
    Quote Originally Posted by Steam
    20:48 - Sky: one does not simply ban him
    20:49 - Wind: we must gather the chaos emeralds and blast him

  3. #3
    Join Date
    April 19th, 2014
    Location
    Poland
    Posts
    211
    Level
    36
    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

  4. #4
    Join Date
    March 25th, 2010
    Posts
    1,442
    Level
    58
    Can you post the full Lua code? I don't know how to fix it unless if you show it.
    Quote Originally Posted by SRB2
    <Mystyc Cheez> I ****ING QUIT
    Mystyc Cheez left the game
    <~Sky> Am I too awesome or something?
    <X\Wind> Why is everyone on red...
    <X\Wind> Is Sky that awesome?
    Quote Originally Posted by Steam
    20:48 - Sky: one does not simply ban him
    20:49 - Wind: we must gather the chaos emeralds and blast him

  5. #5
    Join Date
    April 19th, 2014
    Location
    Poland
    Posts
    211
    Level
    36
    okay you should got on pv hatsandcapsbeta.wad
    Amateur of wading,drawing and Match

  6. #6
    Join Date
    March 25th, 2010
    Posts
    1,442
    Level
    58
    ...what? I don't understand.

    Can you post the full Lua code here?
    Quote Originally Posted by SRB2
    <Mystyc Cheez> I ****ING QUIT
    Mystyc Cheez left the game
    <~Sky> Am I too awesome or something?
    <X\Wind> Why is everyone on red...
    <X\Wind> Is Sky that awesome?
    Quote Originally Posted by Steam
    20:48 - Sky: one does not simply ban him
    20:49 - Wind: we must gather the chaos emeralds and blast him

  7. #7
    Join Date
    April 19th, 2014
    Location
    Poland
    Posts
    211
    Level
    36
    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

  8. #8
    Join Date
    March 16th, 2012
    Location
    I'm at soup
    Posts
    2,370
    Level
    59
    I'm no Lua expert, but would you need a closing parenthesis here?

    Quote Originally Posted by Xkower8181
    addHook("ThinkFrame", do
    for player in players.iterate

  9. #9
    Join Date
    March 25th, 2010
    Posts
    1,442
    Level
    58
    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)
    Quote Originally Posted by SRB2
    <Mystyc Cheez> I ****ING QUIT
    Mystyc Cheez left the game
    <~Sky> Am I too awesome or something?
    <X\Wind> Why is everyone on red...
    <X\Wind> Is Sky that awesome?
    Quote Originally Posted by Steam
    20:48 - Sky: one does not simply ban him
    20:49 - Wind: we must gather the chaos emeralds and blast him

  10. #10
    Join Date
    April 19th, 2014
    Location
    Poland
    Posts
    211
    Level
    36
    Still WARNING: RusssianHat.wad| LUA_BODY: 80: unexpected symbol near ')'
    Amateur of wading,drawing and Match

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •