• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

RPG Creep Respawn System issues

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
Question solved:

So I was following this guide:

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/creep-respawn-gui-65987/

I followed his bug-free custom script trigger:

(Mine)

  • Creep Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Custom value of (Triggering unit)) Greater than 0
      • ((Triggering unit) is Summoned) Not equal to True
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
      • Custom script: local integer ii = GetUnitUserData(GetTriggerUnit())
      • Wait Creep_Respawn_Timer game-time seconds
      • Custom script: call SetUnitUserData(CreateUnit(Player(12),i,GetLocationX(udg_Creep_Respawn_Point[ii]),GetLocationY(udg_Creep_Respawn_Point[ii],270,ii)
      • Set Creep_Respawn_Point[Creep_Respawn_Integer] = (Position of (Picked unit))
When I save, it seems to call out an error: Line 1067: Invalid number of Arguments

What have I done wrong?
I have already looked it through 10 times. Notice that I use Player 12 as creep respawn player, while he uses Neutral Hostile.

Also, how do I define, codewise, how to make the unit face a random angle in the custom script? It is set to 270 in the last custom script.

Last, but not least, I would love to know if his trigger actually leaks? He is using an Array point, so I guess the point information is not lost and can be overwritten?

I think that was all. Hope you will be able to help. :)
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
You can just use local variables in just one trigger to make the respawn system using custom scripts. But I guess your not experienced with that, I can't show you a code because I'm on a phone. These locals are very useful when u need one phase MUI. I always use it when working on heroes respawn.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
Your trigger is over-engineered. I'm creating my map with vJASS but my respawn system is GUI, no need for JASS here. (Triggering unit) is local already.

  • CRS
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to (==) Neutral Hostile
      • (Triggering unit) Not equal to (!=) |cFFFF3502Toothblock|r 0059 <gen>
      • (Triggering unit) Not equal to (!=) |cFF106246The Terrific Sea Giant|r 0018 <gen>
      • (Unit-type of (Triggering unit)) Not equal to (!=) Dummy_For_AoW
      • (Unit-type of (Triggering unit)) Not equal to (!=) Hammer_of_Thor_Dummy
      • (Unit-type of (Triggering unit)) Not equal to (!=) DummyFacingDown
      • (Unit-type of (Triggering unit)) Not equal to (!=) Red Glow (GC)
      • (Unit-type of (Triggering unit)) Not equal to (!=) Dummy (Global)
      • (Unit-type of (Triggering unit)) Not equal to (!=) DE Dummy
      • (Unit-type of (Triggering unit)) Not equal to (!=) DE Harvest Dummy
      • (Unit-type of (Triggering unit)) Not equal to (!=) Angel 6
      • (Unit-type of (Triggering unit)) Not equal to (!=) Awake 2
      • (Unit-type of (Triggering unit)) Not equal to (!=) Explosion 1
      • (Unit-type of (Triggering unit)) Not equal to (!=) Explosion 3
      • (Unit-type of (Triggering unit)) Not equal to (!=) Explosive Arrow
      • (Unit-type of (Triggering unit)) Not equal to (!=) Gate 4
      • (Unit-type of (Triggering unit)) Not equal to (!=) Gate 5
    • Actions
      • Wait 30.00 seconds
      • Set CRS_NoUiRoCRSDP = 0
      • Set CRS_Death_Point = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 512.00 of CRS_Death_Point matching (((Matching unit) is A Hero) Equal to (==) True)) and do (Actions)
        • Loop - Actions
          • Set CRS_NoUiRoCRSDP = (CRS_NoUiRoCRSDP + 1)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • CRS_NoUiRoCRSDP Equal to (==) 0
          • Then - Actions
            • Special Effect - Create a special effect at CRS_Death_Point using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
            • Special Effect - Destroy (Last created special effect)
            • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at CRS_Death_Point facing Default building facing (270.0) degrees
          • Else - Actions
      • Custom script: call RemoveLocation(udg_CRS_Death_Point)
I know, long conditions :-/
 
Level 8
Joined
Jun 13, 2010
Messages
344
" call SetUnitUserData(CreateUnit(Player(12),i,GetLocationX(udg_Creep_Respawn_Point[ii]),GetLocationY(udg_Creep_Respawn_Point[ii],270,ii)"
You are missing an ")" just between the 270 and the comma.

However, I think you shouldnt mess with the unit user data.

Ahh yes i missed one, I see it. :D
So I cannot get to change the angle it will be facing when spawning. Looks rather silly they all face the same way.
But I suppose I can just make them face random angle in the following trigger when they enter playable map area. :)
 
Level 8
Joined
Jan 28, 2016
Messages
486
This isn't exactly related to the problem you have here but in the last line of your code, you have the point set to the 'Position of Picked Unit' which would most likely return the wrong location. Should it be 'Triggering Unit' instead?
 
Level 8
Joined
Jun 13, 2010
Messages
344
This isn't exactly related to the problem you have here but in the last line of your code, you have the point set to the 'Position of Picked Unit' which would most likely return the wrong location. Should it be 'Triggering Unit' instead?

Good eye. I forgot to change it since my previous edit. Thanks, saved me from possible bugs in the future. :)
 
Status
Not open for further replies.
Top