HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need Help : simplfy this LONG GUI trigg into JASS script

09-25-2006, 08:04 AM#1
zen87
ok, this is the respawn system i've come out, its abit different since it
- only activate when all units in a creep camp (unit group) died
- the revived creep camp are different unit (you killed trolls here, later you come back you might see furborg, and later demons might appear (well, so you wont get bored over the same thing over and over again)
- and yes, i see alot of leaks in the trigger, any1 feel free to point it out ?
- and i simply cant write a JASS out of this (many mistake here and there, gave up in the end)
- well if you are willing to help and need the original map you can pm and get it from me

------
basically it has 3 parts, and the number of creep camp involved are 16 so far, it might increases later but never mind that for now.
Trigger:
CreepRespawn I
Collapse Events
Unit - A unit Dies
Collapse Conditions
Unit type of (dying unit) is a Hero equals to false
Collapse Actions
For each (integer A) from 1 to 16, do If all units in CreepGroup[(integer A)] are ded equals to true, then set RespawnBoolean[(integer A)] equals to true
in the first step, it checks that if all the units in a creep camp (CreepGroup array) are dead/alive, if it is all dead, then a respawn boolean is triggered in order to run the second step

Trigger:
CreepRespawn II
Collapse Events
Time - every 25 seconds of game time
Collapse Conditions
Unit type of (dying unit) is a Hero equals to false
Collapse Actions
Collapse For each (integer B) from 1 to 16, do (actions)
Collapse Loop - Actions
Collapse If (All conditions are true) then do (the actions) else do (else action)
Collapse If - conditons
RespawnBoolean[(integer B)] equals to true
((Numbers of units in (units within 800 of centre of RespawnLocation[(integer B)]) matching (matching unit is a Hero) equals to true) equals to zero
*basically it means there is no hero in 800 range of the respawn location
Collapse Then - actions
Collapse If (All conditions are true) then do (the actions) else do (else action)
Collapse If - conditons
(Integer B) equals to 1 //which mean all unit in CreepCamp1 is dead
Collapse Then - Actions
Set RespawnCreepType[1] = troll warlord
Set RespawnCreepType[3] = troll high priest
Set RespawnCreepType[5] = troll berseker
Set RespawnCreepType[2] = furborg ursa warrior
Set RespawnCreepType[4] = furborg
Set RespawnCreepType[6] = furborg
Set RespawnCampI = (integer B) //for step 3
Trigger - Run RespawnCreep III
Else - actions
Collapse If (All conditions are true) then do (the actions) else do (else action)
Collapse If - conditons
(Integer B) equals to 2 //which mean all unit in CreepCamp2 is dead
Collapse Then - Actions
Set RespawnCreepType[1] = DEMON KING
Set RespawnCreepType[3] = (no unit-type)
Set RespawnCreepType[5] = (no unit-type)
Set RespawnCreepType[2] = Necromancer
Set RespawnCreepType[4] = Skel Warrior
Set RespawnCreepType[6] = Skel Mage
Set RespawnCampI = (integer B) //for step 3
Trigger - Run RespawnCreep III
Else - actions
Set RespawnBoolean[(integer B)] equals to false
Else - actions
and it goes on untill the 16th creep camp, setting all the creep spawn in different unit types

and the third part, which is just spawn the creeps, nothing much

Trigger:
CreepRespawn III
Events
Conditions
Collapse Actions
Set RandomNumber = (random integer from 0 to 1) //if 1 it will spawn creep(1,3,5) if 0 it will spawn creep(2,4,6) and it can get more creep camp by doing more complex code on below
Collapse For each (integer B) from 1 to 3, do (actions)
Collapse Loop - Actions
Create 1 RespawnCreepType[((integer A)x2)-RandomNumber] for Neutral Hostile at (Random point in CreepSpawnLoaction(RespawnCampI)) facing (Random Degree)
Add (last created unit) to CreepGroup[(integer B)]

well it is really LONG isnt it... well i do know some simple JASS but i just cant write what i want into JASS... hope some1 will help
09-25-2006, 09:23 AM#2
Fireeye
Well, in my Solution the Respawn is exactly and not that long, but the Init Trigger is very long, test map is attached, hope i didn't forget anything.
With some comments in the Respawntrigger, how to configure.
---Edit---
Ok, here's the random Spawn.
Can be a bit optimized, but at least it works fine.
Attached Files
File type: w3xRespawnsystem.w3x (16.2 KB)
File type: w3xRandRespawnsystem.w3x (16.2 KB)
09-25-2006, 10:03 AM#3
zen87
Quote:
Originally Posted by Fireeye
Well, in my Solution the Respawn is exactly and not that long, but the Init Trigger is very long, test map is attached, hope i didn't forget anything.
With some comments in the Respawntrigger, how to configure.
EXACTLY what i wanted !! thanks a hell lots !!

+rep +rep !!
09-25-2006, 02:29 PM#4
zen87
aik... i just found out that the trigger you gave me only allow me to respawn the same type of creep in the same creep camp, but what im trying to do is spawn different creep in the creep camp when the creep inside is cleared >_<

uhm.... guess i'll link my map here, i havent clear the leaks yet so it might be kinda laggy

well i suggest you play the map for like... 10 minutes and look what in trying to do with the creep respawn then look into the trigger

thanks alot for helping out

---

edit : added a spawnsystem that i modify from Fireeye !!
Attached Files
File type: w3xRandRespawnsystem.w3x (17.6 KB)