Forum rules - please read before posting.

A case for ANDing variables

This may seem a puerile
problem for you but I have tried several hours finding a simple
solution and failed. Here is the problem:


I have 4 enemies (spiders
robots) who have to be destroyed in order to be able to go through a
gate.


This is a simple AND of
variables each of which is set True when it disappears (destroyed),
but now the problem is how to consider a spider “destroyed”? I
have used the Exploder package which when I hit the LMB it
practically disappears and I can confirm it by using Object:Check
Presence or CheckVisibility Actions. I have used your Pickable script too and when I throw it far and away it also does "disappear".


I've tried several
solutions and each one either is excessively long and complex or it
gets in a infinite loop and stalls.


There must be a simple
solution out there for such a typical scene and your help would be
appreciated.

Comments

  • Try using a single local Integer Variable to keep track of the number of spiders destroyed.  Each time one is destroyed, increase the value by 1 using the Variable: Set Action, being sure to prevent each spider from being destroy-able more than once.

    You can then run a Cutscene after each time, which contains a Variable: Check Action to determine if the Variable's value has reached 4 or not.
  • The crux of the problem is
    the actual killing and checking if it is out from the scene.

    I have found the solution
    by daisy-chaining Object:CheckPresence actions one for each spider
    like an AND gate: If spider1 is not present check spider2 , if not
    present check spider3, etc. At the end of this chain if all fail then
    I set an doorsOpen variable true.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.