request for set all to true button for item
Posted: Fri Sep 21, 2012 11:07 pm
in items add a set all to true button..set all to false is annoying because an accident click and then 600+ clicks to fix everything. 
What's your Strategy?
https://forums.matrixgames.com:443/
ORIGINAL: bwheatley
I made an event script to do it but a button would be handy.![]()
ORIGINAL: Jeffrey H.
ORIGINAL: bwheatley
I made an event script to do it but a button would be handy.![]()
Are you a coder IRL ? Just wondering.
Code: Select all
0) ' We should loop and find a way to allow all items to be built by all peoplegroups
1) LOOPER: TempVar0 FROM 0 TO 400
2) EXECUTE: ExecSetItemByPeopleGroup(TempVar0, -1, 1)
3) END LOOPER
ORIGINAL: Jeffrey H.
Question for you. In the example above does tempvar0 hold a value of 400 after execution of the exent or does the editor clear the value after the end looper ?
ORIGINAL: bwheatley
ORIGINAL: Jeffrey H.
Question for you. In the example above does tempvar0 hold a value of 400 after execution of the exent or does the editor clear the value after the end looper ?
All tempvars are scoped to their own event. So event 1 & event 2 can both use tempvar0 and it won't cause a problem.
Now if you wanted to do modules like i do you can use
CallFunction(FUNCTIONNAME) tempvar900-999 as well as tempstring900-999 are passed into the function you call and are returned back to the calling function. Tempvar 0,1,4,5 are sent into the function when using callfunction but are not returned.
I use callfunction for a lot of my stuff to allow things to be a little more modular.
Hopefully that answers your question feel free to ask more if needed.
ORIGINAL: Jeffrey H.
Ya that answers the question, (scope of the tempvars) but I admit that the nuance of the callfunction hasn't sunk in yet. So in your example, if tempvar 950 is set to say 10, somewhere outside the calling function, (not sure how that's possible since the scope prohibits carryover outside the function) it goes in and comes out the same value.
I guess I get it but my old brain can't get the utility of it.
Name: Weather Zone Checker
0) ' What month is it
1) SETVAR: TempVar900 = CheckMonth
2) ' Tempvar952 0 = No Weather Change 1 = Weather Change
3) SETVAR: TempVar952 = 0
4) EXECUTE: CallFunction('Open Weather List')
5) ' Check to see if todays weather gets changed
6) EXECUTE: CallFunction('Check for Weather Change')
7) ' Show the Weather Forecast Now
8) EXECUTE: CallFunction('Show Weather Forecast')
9) ' Draw hexes
10) EXECUTE: CallFunction('Draw Weather on Map')
11) ' There are only 2 rows 0 - current turn, 1 next turn..we need to move it up
12) EXECUTE: CallFunction('move weather up to row 0')
13) ' Do the readiness loss based on weather
14) EXECUTE: CallFunction('Apply Weather Readiness Loss')
15) EMPTY
Name: Open Weather List
0) ' This function opens the appriopriate weather list
1) ' it finds a random row then that row gets dumped into stringlist 0 which is weatherforcecast
2) SETVAR: TempVar902 = 1
3) ' Loop and generate the weather forecast
4) LOOPER: TempVar903 FROM 0 TO 7
5) EXECUTE: CallFunction('Get Random Weather')
6) END LOOPER
Name: Get Random Weather
0) ' This function just generates the random weather for a given cell
1) ' it finds a random row then that row gets dumped into stringlist 0 which is weatherforcecast
2) ' Add the row onto the end of the WeatherList
3) ' Loop and generate the weather forecast
4) SETVAR: TempVar901 = CheckRandomRowStringList(TempVar900, TempVar903)
5) SETVAR: TempVar901 = CheckStringList(TempVar900, TempVar901, TempVar903)
6) ' Add the results to the last row in the weatherforecast string
7) EXECUTE: ExecSetStringList(0, TempVar902, TempVar903, TempVar901)
Name: Check for Weather Change
0) ' This function will randomly modify weather for the current turn then alert back into tempstring952
1) CHECK: CheckRandomPercent =< 35
2) ' We will override tempvar902 to set the row to update to 0
3) SETVAR: TempVar902 = 0
4) SETVAR: TempVar952 = 1
5) LOOPER: TempVar903 FROM 0 TO 7
6) EXECUTE: CallFunction('Get Random Weather')
7) END LOOPER
8) END CHECK
10) CHECK: TempVar952 > 0
11) SETVAR: TempString1 + TempString999
12) SETVAR: TempString1 + '**********ALERT WEATHER FORECAST CHANGE**********'
13) SETVAR: TempString1 + TempString999
14) END CHECK
ORIGINAL: anonymous
In event A, set tempvar 950 to 23, then call event B.
In event B, tempvar 950 is 23, change it to 10, and end event B, return to event A.
In event A, tempvar 950 is 10.
But in event C, the unused tempvar 950 is 0 all the time.
Now, you can get information about the execution of a frequently called event.
ORIGINAL: Jeffrey H.
ORIGINAL: anonymous
In event A, set tempvar 950 to 23, then call event B.
In event B, tempvar 950 is 23, change it to 10, and end event B, return to event A.
In event A, tempvar 950 is 10.
But in event C, the unused tempvar 950 is 0 all the time.
Now, you can get information about the execution of a frequently called event.
OIC, now you can break up the events a bit more, instead of doing everything in one large event.