View Issue Details

IDProjectCategoryLast Update
0009841Shattered HavenSuggestion - Puzzle MechanicsJan 25, 2013 4:25 pm
ReporterGameMaker24 Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Summary0009841: New script conditions: OR and AND
DescriptionI'm using the CANSTILLRUN condition to allow a script to run only if some other script is still able to run. However, I've run into a case where I'd like a script to *not* run if two other scripts have both run. It could still run if either of the scripts have run, but not both.

My thought for syntax is as follows:

AND
Condition1
Condition2
Condition3 (and so on)
ENDAND

An OR condition could work in similar fashion.

These would allow events to occur based on the crossing of any given number of tiles, instead of hinging the event on just one tile, row, or column.

TagsNo tags attached.
Internal WeightFeature Suggestion

Activities

GameMaker24

Nov 4, 2012 10:10 am

manager   ~0028895

Today I came across a case where I would like a script to run only two other scripts have both run. This, again, falls under the AND operator.

In today's example, I would like Lela to mention at the right time that you must change which inventory items you're equipped with, but only if an optional 3rd item is acquired AND the required item is already obtained. Both of these actions already have scripts associated with them in the form of text intros. Therefore, I would test whether Intro1 has run AND Intro2 has run.

Chris_McElligottPark

Nov 5, 2012 8:27 am

administrator   ~0028901

I would think that AND is already supported -- it's all ANDs in terms of the listed conditions. If you put multiple conditions in a row, I'm pretty sure the script won't run if they aren't all met. Is that not what you're seeing?

The OR is definitely something that we'd need to add. Is that a time sensitive thing?

GameMaker24

Nov 18, 2012 10:14 pm

manager   ~0029004

You're right, AND functionality is already covered by simply including multiple conditions. I've set up the most recent example, above, successfully.

The OR function is not time sensitive -- I can always use just one condition, for now, with a side-note that an additional condition is pending.

Chris_McElligottPark

Nov 19, 2012 8:25 am

administrator   ~0029007

Cool, thanks for the clarification. :)

Chris_McElligottPark

Nov 21, 2012 7:41 pm

administrator   ~0029035

Thanks!

* Added the following new script command:
** PLAYERATANY (args: ROW/COL/TILE {Tile1 Tile2 Tile3 etc}, all specified by spaces) - Script is only run if a player is on any of the rows, columns, or exact tiles from the list of numbers provided after teh first argument You can specify as many numbers as you want, just place spaces between all of them.
** This is vastly simpler than adding a generalized OR statement. If there are other specific cases of OR-type commands you need, Zack, then let me know. Unless there really is a need for a generalized OR, which seems doubtful, this sort of script addition is much preferable.

GameMaker24

Nov 23, 2012 2:09 pm

manager   ~0029044

I haven't come up with any specific needs beyond this. After reviewing the list of conditions, I thought of a few "would be nice" ideas. RunsNoMore, CanStillRun, and NPCSpeak might be good candidates. But if you like, we can close this issue until such a time that a compelling actual need arises. PlayerAtAny is going to be a huge help. Thanks!

GameMaker24

Jan 20, 2013 9:55 pm

manager   ~0030042

I'm bumping this issue upward because the OR condition has become much more important. I now have three different versions of a script (Male1P, Female1P, and 2P) as well as a script that should run after any one of these has run.

In tonight's case, I need Willis, the kids, and the Gray Horde to all MOVEFG in separate concurrently-running scripts, which works great except they should all use the OR condition to wait for any one of those three scripts.

Chris_McElligottPark

Jan 20, 2013 10:06 pm

administrator   ~0030043

Is this basically a hasrun with multiple scripts being checked? A generalized OR doesn't seem a good investment of time, but I can build you something equivalent as needed by case.

GameMaker24

Jan 20, 2013 10:39 pm

manager   ~0030045

I've been using RUNSNOMORE, but yes, it needs to check whether any of three scripts have run.

I'm not sure how you can build a case-specific condition, but we can try that if it's the faster solution. I think this issue will appear a few more times in the opening story, but can't say for sure, yet. Normally I could avoid this issue by having a separate script run between the multiple scripts and the final script, but that's not possible in the current case.

GameMaker24

Jan 20, 2013 10:44 pm

manager   ~0030046

Oh, since you said case-specific, I'll note that the series of scripts that need to check for any of three are all those that start with the number 8. (A through K all run at the same time, using WAIT delays to space them out -- that's 11 different scripts at once!) The screen, of course, is 001 C. I currently have them all checking whether the Male1P version has run.

Chris_McElligottPark

Jan 21, 2013 8:19 am

administrator   ~0030048

This is somewhat related, so I'll put this here:

* Added two new script commands:
** CLEARLEVELSCRIPTCOMPLETION
*** (args: Level) - Mark all scripts from a given level as being incomplete (basically this undoes the 'onceonly' flag).
** CLEARSUBLEVELSCRIPTCOMPLETION
*** (args: Level Sublevel) - Mark all scripts from a given sublevel of a level as being incomplete (basically this undoes the 'onceonly' flag).

Chris_McElligottPark

Jan 21, 2013 8:26 am

administrator   ~0030049

Okay, when pairing this with the above, I think this will let you do what you want without getting too crazy:

* Added two new script conditions:
** ANYRUNNOMORE
*** (args: LevelNumber Sublevel <List>ScriptTitle) - Script is only run if any of the specified other scripts were ONCEONLY and have already completed -- 1-n scripts can be noted, each with spaces separating them.
** ALLRUNNOMORE
*** (args: LevelNumber Sublevel <List>ScriptTitle) - Script is only run if all of the specified other scripts were ONCEONLY and have already completed -- 1-n scripts can be noted, each with spaces separating them.

Chris_McElligottPark

Jan 21, 2013 12:06 pm

administrator   ~0030059

Actually the clearing script completion stuff probably won't be that useful now that you have this:

* Added a new script condition: ONCEONLYPERPLAY
** After a single successful execution, this script will not run again during the course of a given playthrough of a level (reloading the level from a save or after dying resets this). Any other script commands that reference 'ONCEONLY' also refer to this command.
** I have tested this with level 095-Main, and it works great with the poison pill and making sure that Pierce runs out there multiple times. However, the bridge is collapsing as he runs across it, and I'm not sure if that's what is supposed to happen or not.

GameMaker24

Jan 25, 2013 2:58 pm

manager   ~0030210

No, the bridge should not break unless one of the players themselves tries to cross it. (If they never try, it never breaks.)

I tried to restore the bridge's behavior by changing Pierce's movement script from OnceOnlyPerPlay to just OnceOnly, but even that doesn't keep the bridge from breaking during Pierce's initial placement script.

It seems that the RunsNoMore and CanStillRun scripts need to look to the OnceOnlyPerPlay tag instead of OnceOnly. The OnceOnly tag is still needed elsewhere in the game, however, to prevent repeating actions such as removing Shadow Man from the end of an overworld level.

Chris_McElligottPark

Jan 25, 2013 3:16 pm

administrator   ~0030215

RunsNoMore and CanStillRun definitely check that... I'm not sure what is going on except that I think perhaps it is logging these as complete when it STARTS the script instead of when it finishes them.

Chris_McElligottPark

Jan 25, 2013 3:20 pm

administrator   ~0030216

* Fixed a bug in the prior version where the game was logging scripts as complete when they started running instead of when they completed.

New compiled version 626.

GameMaker24

Jan 25, 2013 3:23 pm

manager   ~0030217

Okay, now most of the story scripts in the game are broken. :-0 None of the PlayerAt character tutorial messages are appearing any more, even when the only conditions are OnceOnly and PlayerAt. (For example, 3.LelaPromptScythe in 001-C.)

Worse, most of the scripts set to eventually happen in 001-C are happening simultaneously, the moment you set foot in that sublevel. It is very chaotic and makes no sense, lol. :) I'm considering all story scripting to be broken until we sort this out.

I have set up ANYRUNNOMORE to call the haven invasion until after one of three scripts have run, but of course, it's impossible to test right now. :)

GameMaker24

Jan 25, 2013 3:25 pm

manager   ~0030218

I was writing the above note at the same time you were writing / compiling your fix. =) I'll try the new version now. Thanks!

GameMaker24

Jan 25, 2013 3:33 pm

manager   ~0030221

Okay, the game is behaving normally again! You fixed that one faster than I could describe it, lol!

Chris_McElligottPark

Jan 25, 2013 3:38 pm

administrator   ~0030222

Awesome!

GameMaker24

Jan 25, 2013 4:25 pm

manager   ~0030229

Now that you've fixed that last bug, the bridge is not breaking early as Pierce is scripted to cross it. And that's with OnceOnlyPerPlay and PoisonPill testing! :)

Also, I can confirm that AnyRunNoMore is also working properly -- I tested it with all three scenarios.

I think that AllRunNoMore is but a compressed way of creating several conditions at once, but I'm sure I'll like not having to create multiple lines. :)

Issue History

Date Modified Username Field Change
Oct 28, 2012 8:41 pm GameMaker24 New Issue
Oct 28, 2012 8:41 pm GameMaker24 Status new => assigned
Oct 28, 2012 8:41 pm GameMaker24 Assigned To => Chris_McElligottPark
Nov 4, 2012 10:10 am GameMaker24 Note Added: 0028895
Nov 5, 2012 8:27 am Chris_McElligottPark Note Added: 0028901
Nov 18, 2012 10:14 pm GameMaker24 Note Added: 0029004
Nov 19, 2012 8:25 am Chris_McElligottPark Note Added: 0029007
Nov 21, 2012 7:41 pm Chris_McElligottPark Note Added: 0029035
Nov 21, 2012 7:41 pm Chris_McElligottPark Status assigned => feedback
Nov 23, 2012 2:09 pm GameMaker24 Note Added: 0029044
Nov 23, 2012 2:09 pm GameMaker24 Status feedback => assigned
Jan 20, 2013 9:55 pm GameMaker24 Note Added: 0030042
Jan 20, 2013 10:06 pm Chris_McElligottPark Note Added: 0030043
Jan 20, 2013 10:39 pm GameMaker24 Note Added: 0030045
Jan 20, 2013 10:44 pm GameMaker24 Note Added: 0030046
Jan 21, 2013 8:19 am Chris_McElligottPark Note Added: 0030048
Jan 21, 2013 8:26 am Chris_McElligottPark Note Added: 0030049
Jan 21, 2013 8:27 am Chris_McElligottPark Status assigned => feedback
Jan 21, 2013 12:06 pm Chris_McElligottPark Note Added: 0030059
Jan 25, 2013 2:58 pm GameMaker24 Note Added: 0030210
Jan 25, 2013 2:58 pm GameMaker24 Status feedback => assigned
Jan 25, 2013 3:16 pm Chris_McElligottPark Note Added: 0030215
Jan 25, 2013 3:20 pm Chris_McElligottPark Note Added: 0030216
Jan 25, 2013 3:20 pm Chris_McElligottPark Status assigned => resolved
Jan 25, 2013 3:20 pm Chris_McElligottPark Resolution open => fixed
Jan 25, 2013 3:23 pm GameMaker24 Note Added: 0030217
Jan 25, 2013 3:25 pm GameMaker24 Note Added: 0030218
Jan 25, 2013 3:33 pm GameMaker24 Note Added: 0030221
Jan 25, 2013 3:38 pm Chris_McElligottPark Note Added: 0030222
Jan 25, 2013 4:25 pm GameMaker24 Note Added: 0030229