Track multiple statuses from 1 variable

Get help using Construct 2

Post » Sat May 11, 2013 2:15 am

Hey all,

I am wondering if there is a way to load up a single text variable with a bunch of different words, and be able to check if it contains one of those words and be able to delete just the specified words.

I am trying to make a single variable that can store all the statuses applied to a character (like poison or haste) to try to cut down on instance variable, as there are already heaps.

Or if anyone has any other ideas how to manage statuses it would be nice to hear :)
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Post » Sat May 11, 2013 2:41 am

How about using an array?
B
94
S
29
G
11
Posts: 1,545
Reputation: 20,993

Post » Mon May 13, 2013 3:03 am

@ArcadeEd - I actually spent a long time on this after your suggestion, and eventually decided on adding the variables for the condition to the object was in fact just easier to manage. But for additional details like time remaining, times hit, etc. that might be used by the status are stored in a dictionary that is created when the status is applied and linked to the object via UID.

I know it probably sounds a bit much, but it has really made it much easier to manage and debug. With arrays it just takes a little more eventing time to extract the information and when you run into a problem there's a lot more possible reasons for it.
B
27
S
8
G
5
Posts: 429
Reputation: 6,902


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, randomly, spcsmrf and 26 guests