• 🏆 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!

[General] Can someone help me fix this scripting problem?

Status
Not open for further replies.
Level 10
Joined
Jan 20, 2011
Messages
492
Hey guys, I was wondering with my game I am making, my Respawn System for Creeps and when I kill the boss it teleports everyone in the area, works on the first try, but if I come back and try it again, it doesn't work. SO, lets say , I kill the boss and then I get teleported to region, and I come back to kill the boss again, it DOESN'T teleport me. Can anyone tell me what I am doing wrong?

Here is the Coding I've been using;

Creep Respawn System

  • Creep Respawn Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Respawn_Time = 45.00
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Temp_Integer = (Temp_Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Temp_Integer
          • Set Creep_Point[Temp_Integer] = (Position of (Picked unit))
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
      • (Custom value of (Triggering unit)) Greater than 0
    • Actions
      • Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
      • Custom script: local integer ii = GetUnitUserData(GetTriggerUnit())
      • Wait Respawn_Time game-time seconds
      • Custom script: call SetUnitUserData(CreateUnit(Player(12),i,GetLocationX(udg_Creep_Point[ii]),GetLocationY(udg_Creep_Point[ii]),270),ii)
  • Add Creep to Respawn
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set Temp_Integer = (Temp_Integer + 1)
      • Unit - Set the custom value of (Triggering unit) to Temp_Integer
      • Set Creep_Point[Temp_Integer] = (Position of (Triggering unit))
That simply respawns the Neutral Units back to their original position.

Boss Trigger

  • Boss Dungeon 1
    • Events
      • Unit - Arachnos 0050 <gen> Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Dungeon 1 Dungeon Region <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dungeon 1 Dungeon Region <gen> contains (Picked unit)) Equal to True
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Unit - Move (Picked unit) instantly to (Center of Camp 2 <gen>)
              • Sound - Play NewTournament <gen>
              • Game - Display to (All players) for 10.00 seconds the text: |CFF20C000Congratul...
            • Else - Actions
              • Do nothing
      • Unit Group - Pick every unit in (Units in Camp 1 Weather Region <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dungeon 1 Dungeon Region <gen> contains (Picked unit)) Equal to True
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Unit - Move (Picked unit) instantly to (Center of Camp 2 <gen>)
              • Sound - Play NewTournament <gen>
              • Game - Display to (All players) for 10.00 seconds the text: |CFF20C000Congratul...
            • Else - Actions
              • Do nothing
If you're wondering what the music is and the game text is, its to congratulate you for beating the Dungeon, the 2 regions was to stop people from being left behind in other areas.

So an overview of what I am asking is, can someone tell me how to fix it so the trigger works like this, I kill the boss it teleports me to the region and continuously works, instead of it working once then not at all.

If it needs better explaining please let me know
 
Status
Not open for further replies.
Top