Suggestion for Improvement: eBlockNone

Started by Armageddon, Tue 29/01/2013 05:53:15

Previous topic - Next topic

Armageddon

Basically putting Khris' GotThere module into a single eBlock type called eBlockNone (or whatever). So,

Code: ags
cPlayer.Walk(82, 132, eNoneBlock, eWalkableAreas);


Would walk the player to the coords, he can cancel it and click somewhere else while walking there, once he gets there it will play the rest of the script. Sorry if this isn't what this forum is for, if if this has been asked already.

Crimson Wizard

So, basically this is about adding new behavior type, which makes action blocking, but interruptible by some user action.

Armageddon

You can set the actions to do whatever you want, it just walks there before continuing the script, but you can still change your mind while the character is walking and walk somewhere else to cancel it. So if you look at something now and when you look you have the player say "That's interesting.", if you use eNoBlock he will say it before/while he's walking to the location you want him to walk to. So I guess what eBlockNone should do is have everything in the game run normally, unlike eBlock, except the function in the room script won't continue?

I know it sounds really confusing but it shouldn't be. :-[

Crimson Wizard

I think there's a lot to consider. How the interrupting action is set up, how the script should behave after action was interrupted.

MurrayL

#4
At the moment this can be (sort of) done like this:

Code: AGS

function myInteraction(){
    cEgo.Walk(360, 240, eNoBlock);
    
    StartCutscene(eSkipAnyKeyOrMouseClick);
    while(cEgo.Moving && !Game.SkippingCutscene){
        Wait(1);
    }
    cEgo.StopMoving();
    EndCutscene();
}

RickJ

It sounds to me that something like eNoBlock, eBlockSelf, and eBlock is what is being described.  The first and last are of course what we have now.  The eBlockSelf would simply allow the script to continue (as in eNoBlock) until the originating entity (character, object, etc) tried to execute another action.  At that point the script would block (as in (eBlock). For example if Ego is set walking with eBlockSelf.  The script doesn't block until Ego is set walking to another point.

Code: AGS

    cEgo.Walk(360, 240, eBlockSelf);    // Ego starts walking
        :                               // Script continues
        :
    cEgo.Walk(400, 500, eBlockSelf);    // Script blocks here and waits for Ego to 
                                        // stop at which time the new walk instruction 
                                        // is executed. 


It's sort of a poor man's multi-threading feature that could be very effective and useful.

Armageddon

It's the only thing that has ever bothered me about AGS. :P

monkey0506

This belongs in Engine Development. The only thing that would change for this on the editor-side would be the internal script header.

SMF spam blocked by CleanTalk