User Tag List

Results 1 to 3 of 3

Thread: Rts-like Command Please

  1. #1
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,390
    Level
    18
    vBActivity - Bars
    Lv. Percent
    71.08%

    Rts-like Command Please

    I think that the general command we need the most in Zasm is some sort of RTS-like command, like RETURN, RETURNTRUE, RETURNFALSE, RETURNMORE, RETURNLESS. What this does is simple.


    if there is a GOTO command, Zasm stores which line number that GOTO command is internally. When RETURN is used, the script goes to the line number right after that last GOTO. RETURNTRUE, RETURNFALSE, RETURNMORE, RETURNLESS could be used with COMPAREV and COMPARER.

    How would this be useful? Well, say there is a function where you need to cycle through all 10 enemies on the screen. You can do this now by setting REFNPC to the next enemy, then running the function for that enemy. But, because GOTO will have to be set differently depending on whether the NPC exists or not, that means every enemy will have to have it's own function... If the function is really long and complicated, then that could increase the neccessary size of a Zasm script literally by tenfold.

    Not only that, but it's very convenient to use instead of keeping track of lots of line positions or using lots of labels everywhere.

  2. #2
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.52%

    Re: Rts-like Command Please

    You can already do this. Save the return address somewhere (such as on the stack) and then use GOTOR when you want to return.

  3. #3
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,390
    Level
    18
    vBActivity - Bars
    Lv. Percent
    71.08%

    Re: Rts-like Command Please

    Like I said, for convenience. I know it can be done by keeping track of the address, but it's just simpler to have a RETURN command.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social