if ispc $n
    say hi
    delay 2
    say How are you doing?
    delay 2
    if isgood $n
        say Fine day for adventuring!
        delay 2
        say what are you plans?
    else
        say Good day for killing!
        delay 2
        say What are you plans?
    endif
else
    say Hi...
    delay 2
    what are you doing here
endif

now this looks really really ugly to do with progresses, so let me show you
what I did here.  All that happens when a mobprog is set to go off is
program_flow is called, at least in my version.  So first thing I did was
have it keep track of code it has left to do, this is done by making of a
code as you go along.

Lets examine the start:

if ispc $n    (now we can't copy that as the same, because the ifcheck might
change  so i have:   if true/false instead copied and make sure you add a
chk_true and chk_false too!)

    say hi    (no need to copy this, because it was just done)

    delay 2  (dont copy the line but grab the 2, for the delay)

Now if you notice how program_flow works, the rest of the code is actually
all nice and neat already in the 'code' variable.

so you strcat(your_new_copy,code);

now you have what trigger you need to run next program flow.

since you have all the info already, you can throw it in a struct called
delay_prog, or can try to assemble all the needed info from progam flow
later when the delay is triggered its up to you.

If you have an event structure, make a delay_prog event, and throw this in
the loop of things to happen, then call program flow with the new code.  If
you don't, you just have to make something to put in the update_handler,
that will do the same thing.

If you have any more questions I'll feel free to explain anything more.

Josh


Reply via email to