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

[Trigger] Attack-Move to

Status
Not open for further replies.
Edit
-----------------------------------------------------------------------
PROBLEM KINDA SOLVED



>>> Unit Classification = Ward

-----------------------------------------------------------------------

Hi there..

How do i make a unit to not be controlled by its owner (but still be able to attack-move and follow triggered orders, so no pause or unit-owner change)

Just like the "Castle Fight" map..

I have been sitting here all day with wc3 editor and starting to get really tired of this god damn trigger.. :slp:

  • Events
  • Time - Every 0.05 seconds of game time
  • Conditions
  • Actions
  • Unit Group - Pick every unit in (Units owned by player 1 (Red) of type Peasant) and do (Unit Group - Order (Units owned by player 1 (Red) of type Peasant) to attack-move to (Center of Region 000)
With this trigger the units gets fucked up and the map laaag like hell.. :sad:
 
Last edited:
  • Unit Group - Pick every unit in (Units owned by player 1 (Red) of type Peasant) and do (Unit Group - Order (Picked Unit) to attack-move to (Center of Region 000)

Ok the untis takes 1 hour to walk 1 feet.. -.-

The unit gets to many orders on so short time..
Ignore my trigger and focus on what I wrote instead..

CASTLE FIGHT has a system that makes a player not to be able to attack at all or do anything with your units that get spawned out of your buildings..

Ex: A unit is spawned - order that unit to attack-move to "region X" without being able to control your unit that spawns out of the building at all..
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Picking onezilliond and two hundred units every milisecond is not a good idea.
If I were you, I would do this:

E: Unit is issued an order.
C: Unit is selected by player. Unit is peasant.
A: Deselect units. Order Peasant to do his peasantry things what he's supposed to do in your game.
 
PROBLEM SOLVED

I came up with a super-good idea for this system, here you have it if you guys want to make your own "Castle Fight" map in the future:

  • Events
  • Unit - A unit Finishes training a unit
  • Conditions
  • (Owner of (Trained unit)) Equal to Player 1 (Red)
  • Actions
  • Wait 0.01 seconds
  • Unit - Change ownership of (Trained unit to player 11 (Dark Green) and Retain color
  • Wait 0.01 seconds
  • Unit - Order (Ownership-changed unit) to Attack-Move To (Center of Region X <gen>)
This trigger above is only for retain color & unit change
Player 11 is therefor a "dummy-player"...

  • Events
  • Unit - A unit Dies
  • Conditions
  • And - All (Conditions) are true
  • Conditions
  • (Unit-Type of (Dying unit)) Equal to Peasant
  • (Color of (Owner of (Killing Unit))) Equal to Red
  • Actions
  • Floating Text - Create floating text that reads +1 Gold above (Killing unit) with offset 0.00, using font size 8.00, color (100%, 100%, 0%), and 0.00 % transparency
  • Floating Text - Change (Last created floating text): Disable permanence
  • Floating Text -Change lifespan of (Last created floating text) to 2.00 seconds
  • Floating Text -Change the fading age of (Last created floating text) to 2.00 seconds
  • Floating Text -Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
  • Player - Add 1 to Player 1 (Red) Current gold
This trigger above makes, that even if Player 11 is killing a unit, the killing unit is still Red and "Color of killing unit is red ~ Give Player 1 cash, and a floating text that shows it!

Now I know why there only is 10 players allowed in Castle Fight!! hahaha ^^

Finally!! Thought i never would figure this out.. -.-
 
*sigh* You said you want the units to be owned by their original players. Next time make your problem clearer. (^_^)/

Haha! Im sorry m8! :D
I just thought that Castle Fight didnt used "Dummy Players"!! :grin:

Oh well, as always I post a problem and solve it on my own, I really have to explain better... *sigh* :hohum:
 
NEW PROBLEM!!! :cry:

This trigger below works excellent!!

  • Events
  • Unit - A unit Finishes training a unit
  • Conditions
  • (Owner of (Trained unit)) Equal to Player 1 (Red)
  • Actions
  • Wait 0.01 seconds
  • Unit - Change ownership of (Trained unit to player 11 (Dark Green) and Retain color
  • Wait 0.01 seconds
  • Unit - Order (Ownership-changed unit) to Attack-Move To (Center of Region X <gen>)
But this trigger below doesnt work at all *buhuhuhu!!* :cry:
Only works if THE PLAYER is PLAYER 1!! :confused:

  • Events
  • Unit - A unit Dies
  • Conditions
  • And - All (Conditions) are true
  • Conditions
  • (Unit-Type of (Dying unit)) Equal to Peasant
  • (Color of (Owner of (Killing Unit))) Equal to Red
  • Actions
  • Floating Text - Create floating text that reads +1 Gold above (Killing unit) with offset 0.00, using font size 8.00, color (100%, 100%, 0%), and 0.00 % transparency
  • Floating Text - Change (Last created floating text): Disable permanence
  • Floating Text -Change lifespan of (Last created floating text) to 2.00 seconds
  • Floating Text -Change the fading age of (Last created floating text) to 2.00 seconds
  • Floating Text -Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
  • Player - Add 1 to Player 1 (Red) Current gold
Sorry for double post!
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
And - All (Conditions) are true
What's this? :S It doesn't cause a problem but it's unneeded.

Okay, so. Remove the color checking condition.
When you add gold to the player simply refer to the player with the color of killing unit.
Player - Add 1 $ to Player(Color of killing unit).
If the players are able to kill their allies unit or their own unit well, they are going to gain money for them. So if they can make sure they won't.
 
And - All (Conditions) are true
What's this? :S It doesn't cause a problem but it's unneeded.

EDIT: Er, wait, I have to think this over again. Sorry, late here.

There does not exist a trigger with (Color of killing unit) in Wc3 Editor..
And the MAIN POINT with my triggers is that there will be 5 players:

Player 1 finish training a unit ~ Unit change owner to P11 but remains RED color
So when that >RED< P11 UNIT, kills a SPECIFIK UNIT like a Peasant, THEN P1 (That is BLUE) should have the cash!

Player 2 finish training a unit ~ Unit change owner to P11 but remains BLUE color
So when that >BLUE< P11 UNIT, kills a SPECIFIK UNIT like a Peasant, THEN P2 (That is BLUE) should have the cash!

And so on..

"Don't add gold to Red player, but to the Player with the Color of the Killing unit" didnt exist as I guess you also saw ^^

But maaan, how can this be solved..? :confused:

Im thinking like a god damn... snake? :bored:
Wich animal was the expression for "Thinking like a" again? :confused:
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Man, the truth is, I don't feel comfortable in GUI. You have to search for new things for hours.
So make yourself a favour and just do this:

E:
When a unit is created
A:
Set unit's custom user data (I think it's called custom value in GUI) to the player index of the owner player.
Then give it to your player 11 or who, retaining colors.

When the unit is killed:
E:
Unit buys the farm. (yeah! Dallas reference!)
A:
Give Player(Custom Value of Killing unit) +1 gold.

That should do it. (if you don't use the custom value for anything)
Note: if you use the custom value for something I'll explain how to solve it.
 
Man, the truth is, I don't feel comfortable in GUI. You have to search for new things for hours.
So make yourself a favour and just do this:

E:
When a unit is created
A:
Set unit's custom user data (I think it's called custom value in GUI) to the player index of the owner player.
Then give it to your player 11 or who, retaining colors.

When the unit is killed:
E:
Unit buys the farm. (yeah! Dallas reference!)
A:
Give Player(Custom Value of Killing unit) +1 gold.

That should do it. (if you don't use the custom value for anything)
Note: if you use the custom value for something I'll explain how to solve it.

I dont know anything about JASS or Custom Values..
I only use one custom value on a kick system I came over:

  • Events
  • Player - Player 1 (Red) types a chat message containing -kick p2 as An exact match
  • Conditions
  • Actions
  • Custom script set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (units in (Playable map area) owned by Player 2 (Blue)) and do (Unit - Remove (Picked unit) from the game)
  • Game - Defeat Player 2 (Blue) with message: You got kicked!
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
You do not need any JASS knowledge, I was just swearing because I have spent 5 minutes of my life trying to figure out how do you reference to the color of a unit and change it to a player index in GUI. :p I was merely mentioning that things are much easier to see, understand and find in JASS. But enough of the propaganda, pardon me.

Okay, so, the "Unit Custom Value" is an integer variable attached to your unit.
For example, the unit's life is a "real" type variable attached to your unit. Custom Value is a unit attribute you do not see ingame nor in the object editor but it's there and it rocks. (Too bad stupid Blizzard didn't implement a "unit custom string value" thing, it would be awesome.)
To change the unit's custom value you use:
Unit - Set unit's custom value. (or something like that)

What you quoted in your last post is actually a custom script. You used that to remove that group, preventing leaks - very wisely - but it has nothing to do with custom values.

I hope I was clear.
 
Yes you was pretty clear, I guess :p

So I have to make a "custom data" like a variable on this shit.. :/

Gaaah its so hard to make triggers on units that doesnt even exist yet.. -.-

Btw, I have now checked out the Custom Value Trigger.
But how can I continue with this, my custom value habit isnt that helpful haha! ^^
Especially when it comes to:

If a Player 11 Unit has red color and kills a Peasant = Give Player one 1 Gold
If a Player 11 Unit has blue color and kills a Peasant = Give Player two 1 Gold
 
  • Player - Turn Gives Bounty on for Player 11 (Dark green)
and be sure to set the bounty correctly in the object editor for each unit ;)

The problem has changed, obviusly the unit doesnt change owner at all in Castle Fight.

SCREENSHOT NOW AVAILABLE OF MY PROBLEM:

greencircleowner.JPG
You can clearly see that YOU own this unit becouse of the green circle..

greencircleownermarkmoreunits.JPG
AND you can SELECT MORE units wich is even more evidence of that YOU control the units, but control is disabled somehow :S

ownunitproof.JPG
Its so abvious that you own the units, but how can't you make the:
Attack
Attack-Move
Move
Defense
Hold Position
Commands on your units :S

How to make this commands disabled!?!? :S
 
Last edited:
Level 17
Joined
Apr 13, 2008
Messages
1,597
Well, I've never played Castle Fight, to tell the truth :p
I have posted a solution in somewhere on page one. When someone orders the units make the trigger overwrite the command with it's original command. You might want to use that. I don't know how to disable the unit interface and I don't have time to do the research for that since I have to catch a train soon but I think my solution should work fine for you.
The units in CF might have an ability similiar to locust or the chaos ability, I don't know.
 
Locust nakes them even unselectable, you know.
But i don't know what's your problem.

Huh?

In the screenshot, they ARE disabled - or am i wrong?

You can select the locust units, im sure of it..
When coming to think about this even deeper, I really think the units in the Castle Fight map have units trained that has the setting:

"Placeable in editor - False"

You are completely right, they ARE DISABLED..
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Ehm.. you can't select a unit which has the "locust" ability - if so, it'd be a hell of units while casting locust swarm ^^
As far as i know, if the setting "Placeable..." is set to false, you simply can't place it in your editor gui o_O
Last, so they are disabled - do you want them to be enabled or am i wrong ?
 
Ehm.. you can't select a unit which has the "locust" ability - if so, it'd be a hell of units while casting locust swarm ^^
As far as i know, if the setting "Placeable..." is set to false, you simply can't place it in your editor gui o_O
Last, so they are disabled - do you want them to be enabled or am i wrong ?

Locust ability = Wrong
Thats not what I meant..

THE LOCUST UNIT has the SETTING Placeable in editor - FALSE, wich could have something to do with the "Castle Fight map"..

But I have abandoned that idea, tried hundreds of possible settings with "Placeable in editor FALSE" but it just doesnt work..
And there was some wc3 editor bugs I took advantage of:
If you put a trained unit in (ex: Barracks - Footman)
THEN AFTER you have put the footman in Barracks "trained units" you CHANGE the footmans settings to: Placeable in editor - FALSE
The same thing works with triggers! :smile:

But as I said, that Idea is abandoned..

I want the units that be trained to belong to rightfull owner, and I want the commands DISABLED so you cant control them in the game and make them go back or whatever..

Short said:
>>NO CONTROL OF YOUR UNITS, ONLY TRIGGERS CAN MAKE YOUR OWN UNITS DO STUFF<<

simple.JPG
Like this.. :con:


OR a trigger that is laaag-free that makes your units attack-move to the other side..?
That would do..
 
Last edited:
Status
Not open for further replies.
Top