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

How to save a unit's destination?

Status
Not open for further replies.
Level 2
Joined
Jan 6, 2008
Messages
25
Hey, I'm making a map at the moment that is similar to Castle Fight, in that you make buildings and they train automatically, only in this map its an open map where the rally points of your buildings is the destination, and you control resource nodes and such.

My problem is, I want some of my units to have triggered abilities, and that's all well and good, but if I order them to do something with the trigger, they'll lose their movement destination. Is there any way for me to make it so it sort of saves the point they are traveling to (the rally point of the building that trained them) so they will continue attack-moving there after the spellcast? I will accept GUI or Jass helpings, though I'm not familiar enough with Jass to make it myself.

Also one other minor problem, is there a way to make every building that has a point value of 3 (all unit-trainer buildings are gonna have 3 pointvalue) so that every 5 seconds they train whatever unit they have available? I know how to make them train every 5 seconds and all, but for the train a unit trigger it doesn't have any options like 'any unit that it can train" so id have to make an individual trigger or action type thing for each type of building that trains units.
 
Level 12
Joined
Mar 16, 2006
Messages
992
Hey, I'm making a map at the moment that is similar to Castle Fight, in that you make buildings and they train automatically, only in this map its an open map where the rally points of your buildings is the destination, and you control resource nodes and such.

My problem is, I want some of my units to have triggered abilities, and that's all well and good, but if I order them to do something with the trigger, they'll lose their movement destination. Is there any way for me to make it so it sort of saves the point they are traveling to (the rally point of the building that trained them) so they will continue attack-moving there after the spellcast? I will accept GUI or Jass helpings, though I'm not familiar enough with Jass to make it myself.

Also one other minor problem, is there a way to make every building that has a point value of 3 (all unit-trainer buildings are gonna have 3 pointvalue) so that every 5 seconds they train whatever unit they have available? I know how to make them train every 5 seconds and all, but for the train a unit trigger it doesn't have any options like 'any unit that it can train" so id have to make an individual trigger or action type thing for each type of building that trains units.

Couldn't you just store the destination whenever the unit is given an order to move, then delete it when he has either reached his destination or gotten a new one?

And just change his triggered spells to re-order him to move to his stored destination after it's cast?

Also, what kind of ability is it? Couldn't you just change the dummy to an ability that can be cast while moving and go from there?
 
Level 2
Joined
Jan 6, 2008
Messages
25
Well there are various abilities, its going to be similar to Castle Fight as I said, and I could do dummies but then I'd have to emulate the casting animations and such and make it reduce mana with triggers which'd be kind of lame.

donut3.5 could you elaborate please?

Vegavak, that's my biggest question. How would I store his destination, like, the building's rally point? I know there are point variables but then it would be a global variable that would keep 1 point for a long time so it would have to be an array to suit multiple buildings, though I could do that if needed.

How could I store his destination for each and every unit? Any ideas?
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Or Game Cache knowladge

Why do you post full detail about your project anyway
just post what you want

Hey Im making a game like DotA there are 50 heroes first hero is warrior of wilds he has axe throw berserk engage and stormbolt second hero is naga archer has frost arrows chain lightning mana shield tornado third hero is storm breaker has thunder strike storm bolt haste and lightning fury ...........................
...................................
......................................
.......................................
......................................
....................................
...................................
....................................
..................................
...........
and my question is how can I make zwenzar to summon 2 wolves instead of one
 
Level 2
Joined
Jan 6, 2008
Messages
25
Alright, I did it myself using GUI triggers, but now I'm reviving this to post incase anyone else who uses GUI wants to do something like this, at least for rally points.

If you want to be able to send units to the rally point of the building that created them, you need to make 3 separate triggers and an integer variable.

For this, we are naming the integer variable Buildings, and it starts at 0.

1st Trigger:

  • Unit Custom Value
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Point-value of (Triggering unit)) Equal to 3
    • Actions
      • Unit - Set the custom value of (Trained unit) to (Custom value of (Triggering unit))
2nd Trigger:
(I use point-value 3 for all the buildings that train units in my map)
  • Building Custom Value
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Point-value of (Constructed structure)) Equal to 3
    • Actions
    • Set Buildings = (Buildings + 1)
    • Unit - Set the custom value of (Constructed structure) to Buildings
3rd Trigger
is whatever you want it to be that will invoke the movement. Here is an example:

  • The Trigger
    • Events
      • Player - Player 1 (Red) types a chat message containing -move as An exact match
    • Conditions
    • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Unit - Order (Picked unit) to Attack-Move To (Rally-Point of (Random unit from (Units in (Playable map area) matching (((Custom value of (Matching unit)) Equal to (Custom value of (Picked unit))) and ((Point-value of (Matching unit)) Equal to 3)))) as a point
With this setup, anytime you build a structure it gets its own unique value, and you can order units to move to or patrol to or whatever the rally point of the building that trained it.

I'm sure this isn't the best way to do it, but it's an easy way I found, and I hope it helps you if you intend to do something like this.
 
Status
Not open for further replies.
Top