playMaker

Author Topic: Some help with comparing array elements  (Read 1584 times)

keirankozlowski

  • Playmaker Newbie
  • *
  • Posts: 4
Some help with comparing array elements
« on: June 16, 2017, 03:48:29 PM »
Hey guys! Hopefully someone can help me out.

I'm trying to create a system for activating/deactivating creatures in an environment. The way I would like it to function is:

-Player enters trigger, triggers sends event to an activation manager.
-Trigger stores its name in string variable CurrentlyActive.
-Activation manager receives event, then compares an array with all possible string engagement names to CurrentlyActive. It continues to iterate through this array until the index equals the same string as CurrentlyActive.
-Once the condition is true, it activates a specific array of game objects. (I've already got the actual spawning part figured out)

Does anyone have a good handle on how to compare a string variable to a specific index within a string array?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Some help with comparing array elements
« Reply #1 on: June 17, 2017, 02:04:27 AM »
Hi,
Here you can find some tutorials for arrays (and many other tutorials).
There are 2 kinds 'array' and 'array maker' array maker is an older (but more advanced) system, so many things on the tutorials for array maker you can now also do with the standard array actions.

Also you should get the Ecosystem and search for the action : 'Array Get Next2'
This works the same as the standard 'Array Get Next' but it has a 'reset flag'

And you have a 'string compare' action to compare the strings that you get from your array.

keirankozlowski

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Some help with comparing array elements
« Reply #2 on: June 19, 2017, 09:51:44 AM »
Sweet, thanks man!