System CommandParser

quraji

zap
Reaction score
144
@ Azlier: Fade filter.

I managed to do this myself (inconsistencies between vJASS and Zinc = :mad:), but its kind of limited to this strange format:

JASS:
 Command["-gold"].emulatePlayer(Player(4), "-gold 40")

Not sure why you'd need that. But, the Args struct is public so you could make your own if you like the interface.

[ ljass] [ /ljass] without the spaces.
 

quraji

zap
Reaction score
144
I'm thinking of changing the way to use this from:
JASS:
// uses eval
function onCmd takes Args args returns nothing
    // do stuff
endfunction

// to :

// uses exec
function onCmd takes nothing returns nothing
    local Args args = GetCommandArgs() // or something
    // stuff
    call DestroyArgs(args) // call args.destroy()
endfunction

// I haven't actually looked at this system since it got approved so 
// there might be a reason why it's not like this, but probably not.


Not sure why I did the first to begin with, it's kinda weird (as far as the [ljass]takes Args args[/ljass] thing).

Anyone actually use this yet? (or try it?) :p
 

Jesus4Lyf

Good Idea™
Reaction score
397
Alternative is:
JASS:
struct MyCommandStruct extends Args
    implement Command
    private method onCommand takes nothing returns nothing
        // do things with "this", which is your args.
        // it is possible, like this, to fire it with execute AND destroy args when the method
        // finishes firing, even if it uses TriggerSleepAction.
    endmethod
    private static method onInit takes nothing returns nothing
        set this.triggerString="give"
    endmethod
endstruct

Up to you. I don't like the idea of manually destroying.
 

quraji

zap
Reaction score
144
If anyone at all is using or has used this I'd like some feedback on the interface...I'm kind of torn about whether to change it or not.
 

tooltiperror

Super Moderator
Reaction score
231
This is such an awesome system, I love it. Even though I plan on remaking it in Vanilla JASS :thup:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top