Thanks Willuwontu for your reply but I am still struggling to figure it out, I probably didn't explain what I would like very well... You can reply to me like you are writing to a little kid I wont be offended as I am always keen to learn ;-)
Regarding Above
"Any ways, for your problem, make the region variable in the record an array. (check the array box on the variable)"
I am probably asking you very basic questions like my brother once asked me "who stuck the moon up there"
I have attached a photo of how it looks like now and you might have better idea where I am making a mistake.
Thanks
Thundraf
Just Code paste test follows for my own benefit:
<<Gards_To_Posts Events Local Variables X = 0 <Integer> Live Guards = 0 <Integer> Record <Recor_Dawn> Conditions Actions Variable - Set X = 1 Variable - Set Live Guards = (Number of Living units in PC_All_Trooper_Guards) General - If (Conditions) then do multiple (Actions) General - If (Conditions) then do multiple (Actions) General - If (Conditions) then do multiple (Actions) If Then Else General - Else if (Conditions) then do (Actions) Else If Or Conditions TimeOfDay == Early Morning TimeOfDay == Morning TimeOfDay == Afternoon TimeOfDay == Evening Then General - While (Conditions) are true, do (Actions) Conditions X <= Live Guards Actions Unit - Order PC_Guards[X] to ( Scan Move targeting (Random point in Record.(No Value))) (After Existing Orders) Variable - Modify X: + 1 General - Wait 1.0 Game Time seconds General - Wait 2.0 Game Time seconds Trigger - Turn Gards_Roam On>>
<</Gards_To_Posts
Events
Local Variables
X = 0 <Integer>
Live Guards = 0 <Integer>
Record <Recor_Dawn>
Conditions
Actions
Variable - Set X = 1
Variable - Set Live Guards = (Number of Living units in PC_All_Trooper_Guards)
General - If (Conditions) then do multiple (Actions)
General - If (Conditions) then do multiple (Actions)
General - If (Conditions) then do multiple (Actions)
If Then Else
General - Else if (Conditions) then do (Actions)
Else If
Or
Conditions
TimeOfDay == Early Morning
TimeOfDay == Morning
TimeOfDay == Afternoon
TimeOfDay == Evening
Then
General - While (Conditions) are true, do (Actions)
Conditions
X <= Live Guards
Actions
Unit - Order PC_Guards[X] to ( Scan Move targeting (Random point in Record.(No Value))) (After Existing Orders)
Variable - Modify X: + 1
General - Wait 1.0 Game Time seconds
General - Wait 2.0 Game Time seconds
Trigger - Turn Gards_Roam On>>
Sorry bout checking back so late, I only check in every so often here.
Okay so first things first.
Records != Arrays.
Records are essentially a house floor containing many different variables of varying types. Arrays are variables used to hold large amounts of Data of the same type.
You do not need a record for this situation. Instead you need an array.
Create a new global variable of the region type.
Check the Arrays box (See image below)
Change the array size to how many region you want to save (8 I think).
Now you need to load the array with the values of your regions, make a new trigger with a map initialization event called region initialization.
Create a new Integer variable called x
Add the For Each Integer Action to your trigger (see image below)
Set x as the Variable for it, and change it to go from 1 to 8 (see image)
Add a set variable action to it with the variable being the region you created earlier, and the index to x. (See image)
Set the value to the Region From Name Function (See Images)
Set the Name to the Combine Strings Function (See Images)
Set String 1 value to "Terran Guard Dusk/Dawn " and the String 2 value to Convert Integer to string function (see image)
I've run out of attachment space making another post now.
I really appreciate your help! Am busy this Weekend but will get on and check it out soon as I can. And thank you for going through trouble of copy/pasting/editing images to help me! - love the arrow and "X" mark! ;-)
Will let you know how it goes...
Enjoy the weekend...
Ah Willuwontu thank you so much this is brilliant, now I have learned what string does... will save me from lots of clicking. I did had a issue because I had region name as "Terran Guard Dusk/Dawn 1" and therefore a space between "Dusk/Dawn" and "1" which wasn't making string correct. So got rid of the space and voila, guards went to their posts.
Below just a test for posting codes attempt No. 6
Guards_To_PostsEventsLocalVariablesX=0<Integer>LiveGuards=0<Integer>ConditionsActionsVariable-SetLiveGuards=(NumberofLivingunitsinPC_All_Trooper_Guards)General-If(Conditions)thendomultiple(Actions)IfThenElseGeneral-Elseif(Conditions)thendo(Actions)ElseIfTimeOfDay==DayThenGeneral-While(Conditions)aretrue,do(Actions)ConditionsX<=LiveGuardsActionsGeneral-ForeachintegerXfrom1to2withincrement1,do(Actions)ActionsUnit-OrderPC_Guards[X] to ( Scan Move targeting (Random point in PC_Guarding_Day[X])) (After Existing Orders)
General - Wait 1.0 Game Time seconds
General - If (Conditions) then do multiple (Actions)
If Then Else
General - Else if (Conditions) then do (Actions)
Else If
TimeOfDay == Night
Then
General - While (Conditions) are true, do (Actions)
Conditions
X <= Live Guards
Actions
General - For each integer X from 1 to 2 with increment 1, do (Actions)
Actions
Unit - Order PC_Guards[X] to ( Scan Move targeting (Random point in PC_Guarding_Night[X])) (After Existing Orders)
General - Wait 1.0 Game Time seconds
General - If (Conditions) then do multiple (Actions)
If Then Else
General - Else if (Conditions) then do (Actions)
Else If
Or
Conditions
TimeOfDay == Early Morning
TimeOfDay == Morning
TimeOfDay == Afternoon
TimeOfDay == Evening
Then
General - While (Conditions) are true, do (Actions)
Conditions
X <= Live Guards
Actions
General - For each integer X from 1 to 2 with increment 1, do (Actions)
Actions
Unit - Order PC_Guards[X] to ( Scan Move targeting (Random point in PC_Guarding_Night[X])) (After Existing Orders)
General - Wait 1.0 Game Time seconds
General - Wait 1.0 Game Time seconds
General - Wait 2.0 Game Time seconds
Trigger - Turn Gards_Roam On
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Here it is by hand
This Array:
Variable - Set PC_Guarding_Dawn[1] = Terran Guard Dusk/Dawn 1
Variable - Set PC_Guarding_Dawn[2] = Terran Guard Dusk/Dawn 2
Variable - Set PC_Guarding_Dawn[3] = Terran Guard Dusk/Dawn 3
Variable - Set PC_Guarding_Dawn[4] = Terran Guard Dusk/Dawn 4
Variable - Set PC_Guarding_Dawn[5] = Terran Guard Dusk/Dawn 5
Variable - Set PC_Guarding_Dawn[6] = Terran Guard Dusk/Dawn 6
Variable - Set PC_Guarding_Dawn[7] = Terran Guard Dusk/Dawn 7
Variable - Set PC_Guarding_Dawn[8] = Terran Guard Dusk/Dawn 8
I would like in side of record so I can call it in to trigger by Integer Number "X"
This is what I have done and where I am stuck:
Record - PC_Guarding
Variable - Dawn <PC_Guarding[8]>
PC_Guarding
Variables
Untitled Variable 001 = Terran Guard Dusk/Dawn 1 <Region>
Untitled Variable 002 = Terran Guard Dusk/Dawn 2 <Region>
Untitled Variable 003 = Terran Guard Dusk/Dawn 3 <Region>
Untitled Variable 004 = Terran Guard Dusk/Dawn 4 <Region>
Untitled Variable 005 = Terran Guard Dusk/Dawn 5 <Region>
Untitled Variable 006 = Terran Guard Dusk/Dawn 6 <Region>
Untitled Variable 007 = Terran Guard Dusk/Dawn 7 <Region>
Untitled Variable 008 = Terran Guard Dusk/Dawn 8 <Region>
And Trigger comes up like this:
Guards_To_Posts
Events
Local Variables
X = 0 <Integer>
Live Guards = 0 <Integer>
Conditions
Actions
Variable - Set X = 1
Variable - Set Live Guards = (Number of Living units in PC_All_Trooper_Guards)
General - If (Conditions) then do multiple (Actions)
If Then Else
General - Else if (Conditions) then do (Actions)
Else If
TimeOfDay == Early Morning
TimeOfDay == Morning
TimeOfDay == Afternoon
TimeOfDay == Evening
Then
General - While (Conditions) are true, do (Actions)
Conditions
X <= Live Guards
Unit - Order PC_Guards[X] to ( Scan Move targeting (Random point in Dawn[X]Member)) (After Existing Orders)
Variable - Modify X: + 1
And this "Member" is what I don't get. I cant seam to chose Array number from Record as they are all individual. What am I missing?
Any help would be appreciated Thank you
Thundraf
@Thundraf: Go
Oh Come on how you copy paste codes ?! :-( I have clicked Code thing and this is what happens?
Edit: I have change above post 4 - 5 times as everything is connected if i don't add blank line in between and copy, paste is not helping.... :-(
Use the << code>> <</ code >> tags (no spaces)
Any ways, for your problem, make the region variable in the record an array. (check the array box on the variable)
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
Thanks Willuwontu for your reply but I am still struggling to figure it out, I probably didn't explain what I would like very well... You can reply to me like you are writing to a little kid I wont be offended as I am always keen to learn ;-)
Regarding Above "Any ways, for your problem, make the region variable in the record an array. (check the array box on the variable)"
I am probably asking you very basic questions like my brother once asked me "who stuck the moon up there"
I have attached a photo of how it looks like now and you might have better idea where I am making a mistake.
Thanks Thundraf
Just Code paste test follows for my own benefit:
<<Gards_To_Posts Events Local Variables X = 0 <Integer> Live Guards = 0 <Integer> Record <Recor_Dawn> Conditions Actions Variable - Set X = 1 Variable - Set Live Guards = (Number of Living units in PC_All_Trooper_Guards) General - If (Conditions) then do multiple (Actions) General - If (Conditions) then do multiple (Actions) General - If (Conditions) then do multiple (Actions) If Then Else General - Else if (Conditions) then do (Actions) Else If Or Conditions TimeOfDay == Early Morning TimeOfDay == Morning TimeOfDay == Afternoon TimeOfDay == Evening Then General - While (Conditions) are true, do (Actions) Conditions X <= Live Guards Actions Unit - Order PC_Guards[X] to ( Scan Move targeting (Random point in Record.(No Value))) (After Existing Orders) Variable - Modify X: + 1 General - Wait 1.0 Game Time seconds General - Wait 2.0 Game Time seconds Trigger - Turn Gards_Roam On>>
<</Gards_To_Posts Events Local Variables X = 0 <Integer> Live Guards = 0 <Integer> Record <Recor_Dawn> Conditions Actions Variable - Set X = 1 Variable - Set Live Guards = (Number of Living units in PC_All_Trooper_Guards) General - If (Conditions) then do multiple (Actions) General - If (Conditions) then do multiple (Actions) General - If (Conditions) then do multiple (Actions) If Then Else General - Else if (Conditions) then do (Actions) Else If Or Conditions TimeOfDay == Early Morning TimeOfDay == Morning TimeOfDay == Afternoon TimeOfDay == Evening Then General - While (Conditions) are true, do (Actions) Conditions X <= Live Guards Actions Unit - Order PC_Guards[X] to ( Scan Move targeting (Random point in Record.(No Value))) (After Existing Orders) Variable - Modify X: + 1 General - Wait 1.0 Game Time seconds General - Wait 2.0 Game Time seconds Trigger - Turn Gards_Roam On>>
Sorry bout checking back so late, I only check in every so often here.
Okay so first things first.
I've run out of attachment space making another post now.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
That's all.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Cheers Willuwontu,
I really appreciate your help! Am busy this Weekend but will get on and check it out soon as I can. And thank you for going through trouble of copy/pasting/editing images to help me! - love the arrow and "X" mark! ;-) Will let you know how it goes... Enjoy the weekend...
Thundraf
@willuwontu: Go
Ah Willuwontu thank you so much this is brilliant, now I have learned what string does... will save me from lots of clicking. I did had a issue because I had region name as "Terran Guard Dusk/Dawn 1" and therefore a space between "Dusk/Dawn" and "1" which wasn't making string correct. So got rid of the space and voila, guards went to their posts.
Below just a test for posting codes attempt No. 6