Change actor variable in all actors of a certain template?

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
EDX442
Member
 
Joined: Fri May 01, 2015 4:49 am

Change actor variable in all actors of a certain template?

Postby EDX442 » Thu Feb 11, 2016 6:35 am

Is it possible to change the actor variable in all actors in the game of a certain template/team (lets say "Human_Template") at once?

If not, is there a way to keep an actor's timer going indefinitely (when player is not on the map)?

Basically, I want to create a system in which fruit trees & vegetables (the actors) have a 'Water' variable that goes down by 1 every day. Every time it rains, the variable will increase by 5 (for ALL fruit trees etc in the game).

Is such a system possible?



Thanks

User avatar
Lee
001 Support
 
Joined: Thu Sep 21, 2006 1:59 pm
Location: United Kingdom

Re: Change actor variable in all actors of a certain templat

Postby Lee » Thu Feb 11, 2016 6:42 am

If you want this to apply to all fruit trees then a Global Variable might make more sense as that way you don't have to update the individual tree Actor Variables, you just update the Global Variable.
Lee - 001 Community Manager

EDX442
Member
 
Joined: Fri May 01, 2015 4:49 am

Re: Change actor variable in all actors of a certain templat

Postby EDX442 » Thu Feb 11, 2016 6:45 am

The problem with that is the player will have the ability to water the plants individually...

User avatar
Gamerdude
001 Support
 
Joined: Wed Dec 12, 2007 8:56 pm
Location: Australia

Re: Change actor variable in all actors of a certain templat

Postby Gamerdude » Thu Feb 11, 2016 7:02 am

You'd have to use an Actor Loop for the Fruit Tree template and inside, set their actor variable back to 5.
Image
Image

EDX442
Member
 
Joined: Fri May 01, 2015 4:49 am

Re: Change actor variable in all actors of a certain templat

Postby EDX442 » Thu Feb 11, 2016 6:26 pm

Would you be able to give me a short step by step? :?


Can anyone else help me with my dilemma?

I need some way of having the 'Water_Level' actor variable of all my actors with the template 'Fruit' go down every in-game day (regardless of which map the player is currently on). They will also go up by 5 (for example) whenever it rains. The player can also water individual plants.


Please and thank you :)
Last edited by EDX442 on Sat Feb 13, 2016 6:55 pm, edited 1 time in total.
Reason: Automatically merged double post.


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron