Adventure Game Studio

AGS Development => Engine Development => Topic started by: Armageddon on Tue 29/01/2013 05:53:15

Title: Suggestion for Improvement: eBlockNone
Post by: Armageddon on Tue 29/01/2013 05:53:15
Basically putting Khris' GotThere module into a single eBlock type called eBlockNone (or whatever). So,

Code (ags) Select
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.
Title: Re: Suggestion for Improvement: eBlockNone
Post by: Crimson Wizard on Tue 29/01/2013 07:25:41
So, basically this is about adding new behavior type, which makes action blocking, but interruptible by some user action.
Title: Re: Suggestion for Improvement: eBlockNone
Post by: Armageddon on Tue 29/01/2013 07:54:22
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. :-[
Title: Re: Suggestion for Improvement: eBlockNone
Post by: Crimson Wizard on Tue 29/01/2013 08:08:02
I think there's a lot to consider. How the interrupting action is set up, how the script should behave after action was interrupted.
Title: Re: Suggestion for Improvement: eBlockNone
Post by: MurrayL on Tue 29/01/2013 17:57:12
At the moment this can be (sort of) done like this:

Code (AGS) Select

function myInteraction(){
    cEgo.Walk(360, 240, eNoBlock);
   
    StartCutscene(eSkipAnyKeyOrMouseClick);
    while(cEgo.Moving && !Game.SkippingCutscene){
        Wait(1);
    }
    cEgo.StopMoving();
    EndCutscene();
}
Title: Re: Suggestion for Improvement: eBlockNone
Post by: RickJ on Tue 29/01/2013 21:11:10
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) Select

    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.
Title: Re: Suggestion for Improvement: eBlockNone
Post by: Armageddon on Wed 30/01/2013 00:00:01
It's the only thing that has ever bothered me about AGS. :P
Title: Re: Suggestion for Improvement: eBlockNone
Post by: monkey0506 on Thu 07/02/2013 21:56:17
This belongs in Engine Development. The only thing that would change for this on the editor-side would be the internal script header.