Cannot get the units to be replaced.

Zanderist

New Member
Reaction score
5
attachment.php


What I want to happen in this trigger is that a unit structure(s) will be replaced with a footman. This doesn't work. Though I am able to create footmen at the point where the structures stand.

I think I may have to kill the structure, and have 1 foot man spawn at the point of dying unit.
 

Zanderist

New Member
Reaction score
5
The range point is being set through out the map by a builder unit.


What the builder does is builds a scout tower (custom unit) which in turns gets added into a unit array variable. Which makes this trigger possible.

Pay no attention to The floating text, it is something I left over from before.

(btw Range is a tower in the middle of the map, that is invincible.)



Another question,

Can I also set a range distance condition. Meaning, only towers between ranges 100 and 3000 will get replaced?


"Replace unit if and only if within 100< x >3000 from range"
 

Bogrim

y hello thar
Reaction score
154
Your loop is the problem. Read this tutorial. Basically your loop should follow this structure:

Trigger:
  • Actions
    • Custom Script: local integer i
    • If (Increasing_Array Equal to 8192) then do (Set Increasing_Array = 0) else do (Set Increasing_Array = (Increasing_Array + 1))
    • Custom script: set i = udg_Increasing_Array
    • Custom script: set udg_Temp_Integer = i
    • For each (Integer C[Temp_Integer]) from 1 to 10, do (Actions)
      • Loop - Actions
        • Wait 0.00 seconds
        • Custom script: set udg_Temp_Integer = i
 

Zanderist

New Member
Reaction score
5
I've already stated that custom scripts will not function in any map I make.

Which pisses me off.

It's funny because I can get the loop to work with everything else, but replace units.

I can create, and destroy units, but not replace.
 

Bogrim

y hello thar
Reaction score
154
No, you didn't state you couldn't use custom scripts. I seriously recommend reinstalling WC3 and patching up to the latest version. It sounds more like your game is broken.
 

Zanderist

New Member
Reaction score
5
No, you didn't state you couldn't use custom scripts. I seriously recommend reinstalling WC3 and patching up to the latest version. It sounds more like your game is broken.

My game has been working and hasn't had any trouble, it's only when I try to use a custom script it disables the function because it doesn't understand it.

And my game is up to date.

I'd love to use a custom script to stream line everything.
 

Bogrim

y hello thar
Reaction score
154
Zanderist, nothing of what you're saying right now is making any sense. Custom scripts are just jass, and all actions in the GUI are also jass but in the form of templates. If you're suggesting that you can't use custom scripts, then your game is broken. If not, it's more likely that you're doing it wrong and you need to try harder to benefit from the help we offer.

That the loop began working the moment you removed the wait is also a clear indication that it was the integer variable you used for the loop that made your trigger break, just as I said earlier. Read the tutorial I linked, it explains thoroughly how and why your first loop didn't work.
 

Zanderist

New Member
Reaction score
5
okay, Custom script codes work, I just did your first part of your tutorial.

And I had no problems.

I just don't understand though, I had a priest heal a unit and I didn't see anything.

Never mind I see it now
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top