HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

String not being set - Codemaker

04-18-2007, 01:16 PM#1
Funness
Trigger:
Settings
Collapse Events
Time - Elapsed game time is 1.00 seconds
Conditions
Collapse Actions
Set codemaker_size[0] = 7
-------- EXP --------
Set codemaker_size[1] = 26
-------- Stats --------
Set codemaker_size[2] = 9
Set codemaker_size[3] = 9
Set codemaker_size[4] = 9
-------- Gold/Lumber --------
Set codemaker_size[5] = 20
Set codemaker_size[6] = 20
-------- Karma --------
Set codemaker_size[7] = 10

Trigger:
Save
Collapse Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Player - Player 2 (Blue) types a chat message containing -save as An exact match
Player - Player 3 (Teal) types a chat message containing -save as An exact match
Player - Player 4 (Purple) types a chat message containing -save as An exact match
Player - Player 5 (Yellow) types a chat message containing -save as An exact match
Player - Player 6 (Orange) types a chat message containing -save as An exact match
Player - Player 7 (Green) types a chat message containing -save as An exact match
Player - Player 8 (Pink) types a chat message containing -save as An exact match
Player - Player 9 (Gray) types a chat message containing -save as An exact match
Conditions
Collapse Actions
Unit Group - Remove all units of tempgroup from tempgroup
Set tempgroup = (Units in (Playable map area))
Collapse Unit Group - Pick every unit in tempgroup and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) is A Hero) Equal to True
(Owner of (Picked unit)) Equal to (Triggering player)
Collapse Then - Actions
Set tempunit = (Picked unit)
Collapse Else - Actions
Do nothing
Set codemaker_vals[1] = (Hero experience of tempunit)
Set codemaker_vals[2] = (Strength of tempunit (Exclude bonuses))
Set codemaker_vals[3] = (Agility of tempunit (Exclude bonuses))
Set codemaker_vals[4] = (Intelligence of tempunit (Exclude bonuses))
Set codemaker_vals[5] = ((Triggering player) Current gold)
Set codemaker_vals[6] = ((Triggering player) Current lumber)
Set codemaker_vals[7] = karma[(Player number of (Triggering player))]
Set tmPlayer = (Triggering player)
Custom script: set udg_TemString=Codemaker_GenerateCode( udg_tmPlayer )
Custom script: set udg_TemString = Codemaker_HighlightCode(udg_TemString,"FFFF0000" , "FF0055FF", "FFFFFF00" )
Game - Display to (Triggering player), at offset (0.00, 0.00) for 120.00 seconds the text: The save code is co...
Game - Display to (Triggering player), at offset (0.00, 0.00) for 120.00 seconds the text: (Your hero has been saved; the code is: + TemString)
Game - Display to (Triggering player), at offset (0.00, 0.00) for 120.00 seconds the text: The above code is y...


These are my two current triggers. I do not know jass, I am a GUI triggerer, hence why I am using a series of integers to save the stats based off the "Switchs" demo. While I know I am not saving the type of hero/items currently, that will come later.

But my problem is, the code it generates is always the same, no matter how much the stats change, how much the XP changes..

my charmap is AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsUuVvWwXxYyZz0192837465#$%& and my FCS size is 13.
04-18-2007, 01:25 PM#2
Vexorian
I don't trust your method for picking tempunit too much
04-19-2007, 12:01 AM#3
Funness
Trigger:
Save
Collapse Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Player - Player 2 (Blue) types a chat message containing -save as An exact match
Player - Player 3 (Teal) types a chat message containing -save as An exact match
Player - Player 4 (Purple) types a chat message containing -save as An exact match
Player - Player 5 (Yellow) types a chat message containing -save as An exact match
Player - Player 6 (Orange) types a chat message containing -save as An exact match
Player - Player 7 (Green) types a chat message containing -save as An exact match
Player - Player 8 (Pink) types a chat message containing -save as An exact match
Player - Player 9 (Gray) types a chat message containing -save as An exact match
Conditions
Collapse Actions
Set codemaker_vals[1] = (Hero experience of PlayerHero[(Player number of (Triggering player))])
Set codemaker_vals[2] = (Strength of PlayerHero[(Player number of (Triggering player))] (Exclude bonuses))
Set codemaker_vals[3] = (Agility of PlayerHero[(Player number of (Triggering player))] (Exclude bonuses))
Set codemaker_vals[4] = (Intelligence of PlayerHero[(Player number of (Triggering player))] (Exclude bonuses))
Set codemaker_vals[5] = ((Triggering player) Current gold)
Set codemaker_vals[6] = ((Triggering player) Current lumber)
Set codemaker_vals[7] = karma[(Player number of (Triggering player))]
Set tmPlayer = (Triggering player)
Custom script: set udg_TemString=Codemaker_GenerateCode( udg_tmPlayer )
Custom script: set udg_TemString = Codemaker_HighlightCode(udg_TemString,"FFFF0000" , "FF0055FF", "FFFFFF00" )
Game - Display to (Triggering player), at offset (0.00, 0.00) for 120.00 seconds the text: The save code is co...
Game - Display to (Triggering player), at offset (0.00, 0.00) for 120.00 seconds the text: (Your hero has been saved; the code is: + TemString)
Game - Display to (Triggering player), at offset (0.00, 0.00) for 120.00 seconds the text: The above code is y...
Unit Group - Remove all units of tempgroup from tempgroup

where PlayerHero is set via
Trigger:
Set PlayerHero[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)

But, the code does not even save the gold/lumber. The code just stays a AfA..


Edit:

Totaly my fault, in the settings, I set codemaker_size[0] = 7, the number O values I want... I ment to set codemeker_vals[0] = 7.. Works like a charm now, thankyou.