• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Saving and Loading

Status
Not open for further replies.
Level 5
Joined
Dec 13, 2008
Messages
141
Feeling a tad confused here.
I'm using Code Generator in my survival map, and I'm trying to add the points (rank points) in the save system to be saved, and its not working. Confused on how to add it correctly, and the points system is based on a variable called "Points[Index]", and index is replaced with the player's number (I.E, Player 1 Red, Player 2 Blue, etc).

Can some one help me on how to do this right, because the integer I'm trying to get saved (and for any player, also to show up on a multiboard) is a variable for all players, excluding CPU.
 
I don't get it, but I think you want this?:
  • For each (IntegerA) from 1 to 12, do (Actions)
  • Loop - Actions
    • Set Points[Player Number of (Player(IntegerA))] = (Player(IntegerA)'s start location)
  • ----And this custom script is how to remove the leak of those points:----
  • Custom script: call RemoveLocation (udg_Points[GetConvertedPlayerId(ConvertedPlayer(bj_forLoopAIndex))])
 
Level 5
Joined
Dec 13, 2008
Messages
141
I don't get it, but I think you want this?:
  • For each (IntegerA) from 1 to 12, do (Actions)
  • Loop - Actions
    • Set Points[Player Number of (Player(IntegerA))] = (Player(IntegerA)'s start location)
  • ----And this custom script is how to remove the leak of those points:----
  • Custom script: call RemoveLocation (udg_Points[GetConvertedPlayerId(ConvertedPlayer(bj_forLoopAIndex))])

Would it help if i mentioned it to sound a little like Dawn of the Dead's ranking system? Or Undead Assault's points/rank system, then they are saved when you typed save?
 
Level 5
Joined
Dec 13, 2008
Messages
141
Well...
The points system I used is something here someone uploaded on Hive and was using AceHart's save/load. The problem with that was the save/load custom script had errors, so I couldn't use it, so I switched to Code Generator by TriggerHappy.

I didn't know how to set up the points exactly, because all I did was this:
  • Events
  • Map Initialization
  • Condition
  • Actions
  • --------Characters Used in Code-----------
  • Set Alphabet = KvMuhyS1ncY@CP&Odx5jQLeIJt0$XNlpTaBm4rizVo6GE#sAwHD28kUf3FbRq%9Z7gW
  • --------Color Pattern--------------
  • Set UPPER_CASE_COLOR = |c000080C0
  • Set LOWER_CASE_COLOR = |c0000FF00
  • Set OTHER_CHAR_COLOR = |c00FF0000
  • --------Save Player Name?----------
  • Set SavePlayerName = True
  • --------Points to be saved----------
  • Set Save[Points[(Player Number of (Owner of (Attacking Unit)))] = Points[(Player Number of (Owner of (Attacking Unit)))]
  • Set Save[SaveCount] = (SaveCount + 1)
Then I did this to the save and load:
  • ----Save the Points----
  • Set Save[1] = Points[(Player Number of (Triggering Player))]
  • Set SaveCount = 1
  • Custom Script: set udg_Save[udg_SaveCount] = CG_SaveHero(udg_Hero)
I didn't know what to do with that saving the hero custom script.

And this is what I did to the Load trigger:
  • -----Load the Points------
  • Set LoadCount = 1
  • Set Points[(Player Number of (Triggering Player))] = 0
  • For Each (Integer A) from 1 to SaveCount, do (Actions)
  • Loop - Actions
  • Game - Display to (Player Group((Triggering Player))) the text: (Decode + (String(Save[IntegerA])))
  • Set Points[(Player Number of (Triggering Player))] = Save[1]
I grabbed that part at the bottom of the save/load in the map that I downloaded to use this points system, apparently the save/load's custom script had alot of expectation errors.

The save works, and for some reason, gives ME the same code over and over, and when I load it, it doesn't work.
 
Level 5
Joined
Dec 13, 2008
Messages
141
can you upload the map so that we can see the whole triggers? you need to make sure that the save number is equal to the load number...

btw, why did you save at the map init? and that trigger has errors... you use (Owner of Attacking unit) while your event is map init...

Thats the SETUP trigger.
 
Level 5
Joined
Dec 13, 2008
Messages
141
I mean that set up part wont work because the event was map init but you use (Owner of Attacking unit) which would then be equal to null becuase there is no attacking unit...

Well yeah... I didn't know wtf to use so I just used that.
What would I have used?
 
So what you're saying is, if I did THAT, the code would work if I loaded it?

I'm not sure... thats why I said that you upload the whole map so we can take a look at the triggers and also try to find a solution hands on... and also you still havent said what was not working with the save-load...
 
Level 5
Joined
Dec 13, 2008
Messages
141
I'm not sure... thats why I said that you upload the whole map so we can take a look at the triggers and also try to find a solution hands on... and also you still havent said what was not working with the save-load...

Thought I already did.
 
Level 5
Joined
Dec 13, 2008
Messages
141
Well...
The points system I used is something here someone uploaded on Hive and was using AceHart's save/load. The problem with that was the save/load custom script had errors, so I couldn't use it, so I switched to Code Generator by TriggerHappy.

I didn't know how to set up the points exactly, because all I did was this:
  • Events
  • Map Initialization
  • Condition
  • Actions
  • --------Characters Used in Code-----------
  • Set Alphabet = KvMuhyS1ncY@CP&Odx5jQLeIJt0$XNlpTaBm4rizVo6GE#sAwHD28kUf3FbRq%9Z7gW
  • --------Color Pattern--------------
  • Set UPPER_CASE_COLOR = |c000080C0
  • Set LOWER_CASE_COLOR = |c0000FF00
  • Set OTHER_CHAR_COLOR = |c00FF0000
  • --------Save Player Name?----------
  • Set SavePlayerName = True
  • --------Points to be saved----------
  • Set Save[Points[(Player Number of (Owner of (Attacking Unit)))] = Points[(Player Number of (Owner of (Attacking Unit)))]
  • Set Save[SaveCount] = (SaveCount + 1)
Then I did this to the save and load:
  • ----Save the Points----
  • Set Save[1] = Points[(Player Number of (Triggering Player))]
  • Set SaveCount = 1
  • Custom Script: set udg_Save[udg_SaveCount] = CG_SaveHero(udg_Hero)
I didn't know what to do with that saving the hero custom script.

And this is what I did to the Load trigger:
  • -----Load the Points------
  • Set LoadCount = 1
  • Set Points[(Player Number of (Triggering Player))] = 0
  • For Each (Integer A) from 1 to SaveCount, do (Actions)
  • Loop - Actions
  • Game - Display to (Player Group((Triggering Player))) the text: (Decode + (String(Save[IntegerA])))
  • Set Points[(Player Number of (Triggering Player))] = Save[1]
I grabbed that part at the bottom of the save/load in the map that I downloaded to use this points system, apparently the save/load's custom script had alot of expectation errors.

The save works, and for some reason, gives ME the same code over and over, and when I load it, it doesn't work.

This whole post includes what you would need to look at, because thats the only thing I changed.
 
This whole post includes what you would need to look at, because thats the only thing I changed.

I thought I posted above that it would be easier if we can work HANDS ON with the triggers, thats why I was asking if you can upload the map. can't you understand? and what do you mean by it doesnt work when you load? It doesnt load anything or it says error loading code?
 
This be right answer.

then its the more important if we can see the whole map because it might be related to the custom scripts of the save-load system...

btw, did you delete all lines on the save and load trigger and then just placed the lines in the triggers above? if you did then that might cause your problem because that could mean that you are saving an incomplete code...

PS: please post the map...
 
Level 5
Joined
Dec 13, 2008
Messages
141
btw, did you delete all lines on the save and load trigger and then just placed the lines in the triggers above? if you did then that might cause your problem because that could mean that you are saving an incomplete code...

Wouldn't need the map to just see triggers and custom scripts. also... I cant. I kinda removed the save/load and custom script later because i was searching for systems I can use.
I've heard of Neostorm's Save/Load system, but its not much anywhere, and last link I saw it on was on TheHelper.net. I searched it. lol, anyways..
Why not tell me how to add a integer variable to the Setup and Save, then make it load on the Load trigger, as the variable is an array, because it chooses for all players.
 
this should be pretty easy because the system you use supports easy adding of things to be saved... I mean you can just add a line to both the save trigger and load trigger... maybe its just that you have deleted some important lines from the triggers...

anyway, I would still say that its easier if you upload the map... you can even just upload a version of the map with only the triggers intact...
 
Level 5
Joined
Dec 13, 2008
Messages
141
anyway, I would still say that its easier if you upload the map... you can even just upload a version of the map with only the triggers intact...

no can do. Those are protected... and I save over them before testing. yeah....
Why not just tell me instead? I can just experiment with what I need and can not delete.
 
Status
Not open for further replies.
Top