| 09-24-2004, 02:12 AM | #1 |
I am making a save/load hero code for a map of mine, and it has 37 hero codes, which means 37 hero save actions for 12 separate triggers. (that is a lot of pointing and clicking) I was wondering, is there a way to change certain parts of a trigger to something else, all at once? Like, say i have 20 action like this in one trigger: Code:
If Unit-type of triggering unit equal to Demon Hunter then do create 1 potion of mana at position of triggering unit else do nothing. For example purposes, is there a way to say, change the 1st triggering unit function to picked unit in all 20? |
| 09-25-2004, 02:28 PM | #2 |
I'm not sure what you mean, but it sounds like you're talking about arrays... Variables: - HeroTypes :: Unit-Type Array - HeroCode :: Integer Event: - Map Initialization Actions: - Set HeroTypes[1] = Demon Hunter - Set HeroTypes[2] = Warden - Set HeroTypes[3] = Paladin - Set HeroTypes[4] = Archmage Event: - <A hero is loaded> Actions - Set HeroCode = (Convert String to Integer (<whatever the code is<)) - Create 1 HeroTypes[HeroCode] for (player) at (point) You're trying to save and load heroes with passwords. So basically, if you're looking at string, you find the code that pertains to the hero. Then use it's index position. If the number is 1, then the Demon Hunter is loaded. If it's 3, then the Paladin is loaded. There already are some decent hero load/save codes out there--look at them and learn how they work. |
| 09-26-2004, 06:18 PM | #3 |
I guess i should clarify. My bad ![]() In that code, lets say i have it 20 times in one trigger, with each action having a different hero used. Now I am lazy, and i don't want to change all 20 (triggering unit) functions to (picked unit) functions one by one. Is there a way to change all of the (triggering unit) functions to (picked unit) functions all at once, without copying and pasting? I hope that clarifies it a bit. |
| 09-26-2004, 06:29 PM | #4 |
well, thats one of the biggest plusses to jass, you can find and replace words. so you could do find and replace GetTriggeringUnit() with GetEnumUnit() edit: oh yeah, theres no way in gui. you just have to do it long hard slow way. |
| 09-26-2004, 07:28 PM | #5 |
Damn. I was hoping that the v. 1.17 patch would add something to do that. Oh well. Thanks you 2 for responding. Reputation points all around! P.S. LOVE the blinky avatar Twistar. |
| 09-26-2004, 09:31 PM | #6 |
Really things like that can be tedious, but really, 30 mis of changing things around is worth it i think. Like I have to modify all the creeps for a TD. It takes a while, but it's a sure thing to work. Instead of trying to modify everything in a trigger or something. |
