So I have a bit of trouble with my code, it's not reacting at all... currently my code looks like...
Events
Game - Map Initialization
Local Variables
Trash = 0 <Integer>
Conditions
Actions
Unit - Create 1 (Unit)* for player 12* at Point 1 using point facing (No Options)
Unit Group - Add (Last created unit) to Heroes
Unit - Create 1 (Unit)* for player 12 at Point 2 using point facing (No Options)
Unit Group - Add (Last created unit) to Heroes
etc etc etc
General 0 For each integer Trash from 1 to 10 with increment 1, do (Actions)
Actions
Player - Make player 12 treat player Trash as Neutral With Shared Vision
Visibility - Create a visibility revealer for player Trash within Vision*
Unit - Create 1 Civilian (Male) for player Trash at Unit Select Start Point using default facing (Ignore Placement)
Camera - Pan the camera for player Trash to (Unit Select Start Point facing 270.0 degrees) over 0.0 seconds with Existing Velocity% initial velocity, 0% deceleration, and Do use smart panning
*Insert unit name, it was selected so there's no typo.
*P12 is my neutral comp
*Vision is a region where everything gets vision.
This first part works, the next part doesn't.
Events
Unit - Any Unit is attacked
Conditions
((Triggering unit) is in Heroes) == True
(Duration of Start Select Timer*) != 0.0
Actions
Unit - Change ownership of (Triggering unit) to player (Owner of (Returns the unit who last attacked the specified unit (Triggering unit))) and Change Color
Unit - Kill (Returns the unit who last attacked the specified unit (Triggering unit))
Nothing happens when I do this.
*Start Select Timer is a 60 second timer on map initialize in another trigger.
Any suggestions on what's wrong or how to improve?
Also, since I'm asking questions, is it possible to use the raw data editor? I try modifying it but after I compile I can't save it. If I export it, I can't import it and it's frustrating when it saves me time from clicking 80000 times to get something done.
first thing to do whenever 'nothing happens' is to check if conditions result in true. Add show text message bool to string.
Unit is attacked is a poor event for this, try Unit takes damage, you can get damaging unit and triggering unit.
Yes you can code in code, you can create custom script or there are other ways about which others here will probably tell. Personally i prefer GUI even when i like to code because with massive amounts of triggers etc is easier to find anything.
If you have error while compiling what's the error?
I had already made regions in front of each unit, so what I did to fix it was take the "long approach" (10 minutes of suffering through finger spammage, versus 4 hours of scratching head and figuring out what's wrong while adding new code) and have it move the region away and kill the unit that walks onto the region. It then creates the unit that was behind the region at another point, however I don't know how to kill the unit behind the region (it's at a point, not a region).
There's no compile error, just that nothing "happens" when I attack the units. Although I've changed my approach. Right now my error is... just wanting faster ways of using the editor, if only I knew how to actually use the Raw Data Editor, because I know coding and so I could use the Ctrl + F11 to make things faster after doing it once on a Trigger, I just can't put it from the Ctrl + F11 back onto my game.
EDIT: Can someone point me to a working guide where it shows you how to add skills onto units? I want it to be like WC3 Custom Maps status where you "buy" a skill from a shop.
Also, how do I test a map with friends or do I have to publish onto B.net v2.0?
So I have a bit of trouble with my code, it's not reacting at all... currently my code looks like...
Events
Game - Map Initialization
Local Variables
Trash = 0 <Integer>
Conditions
Actions
Unit - Create 1 (Unit)* for player 12* at Point 1 using point facing (No Options)
Unit Group - Add (Last created unit) to Heroes
Unit - Create 1 (Unit)* for player 12 at Point 2 using point facing (No Options)
Unit Group - Add (Last created unit) to Heroes
etc etc etc
General 0 For each integer Trash from 1 to 10 with increment 1, do (Actions)
Actions
Player - Make player 12 treat player Trash as Neutral With Shared Vision
Visibility - Create a visibility revealer for player Trash within Vision*
Unit - Create 1 Civilian (Male) for player Trash at Unit Select Start Point using default facing (Ignore Placement)
Camera - Pan the camera for player Trash to (Unit Select Start Point facing 270.0 degrees) over 0.0 seconds with Existing Velocity% initial velocity, 0% deceleration, and Do use smart panning
*Insert unit name, it was selected so there's no typo.
*P12 is my neutral comp
*Vision is a region where everything gets vision.
This first part works, the next part doesn't.
Events
Unit - Any Unit is attacked
Conditions
((Triggering unit) is in Heroes) == True
(Duration of Start Select Timer*) != 0.0
Actions
Unit - Change ownership of (Triggering unit) to player (Owner of (Returns the unit who last attacked the specified unit (Triggering unit))) and Change Color
Unit - Kill (Returns the unit who last attacked the specified unit (Triggering unit))
Nothing happens when I do this.
*Start Select Timer is a 60 second timer on map initialize in another trigger.
Any suggestions on what's wrong or how to improve?
Also, since I'm asking questions, is it possible to use the raw data editor? I try modifying it but after I compile I can't save it. If I export it, I can't import it and it's frustrating when it saves me time from clicking 80000 times to get something done.
first thing to do whenever 'nothing happens' is to check if conditions result in true. Add show text message bool to string.
Unit is attacked is a poor event for this, try Unit takes damage, you can get damaging unit and triggering unit.
Yes you can code in code, you can create custom script or there are other ways about which others here will probably tell. Personally i prefer GUI even when i like to code because with massive amounts of triggers etc is easier to find anything.
If you have error while compiling what's the error?
I had already made regions in front of each unit, so what I did to fix it was take the "long approach" (10 minutes of suffering through finger spammage, versus 4 hours of scratching head and figuring out what's wrong while adding new code) and have it move the region away and kill the unit that walks onto the region. It then creates the unit that was behind the region at another point, however I don't know how to kill the unit behind the region (it's at a point, not a region).
There's no compile error, just that nothing "happens" when I attack the units. Although I've changed my approach. Right now my error is... just wanting faster ways of using the editor, if only I knew how to actually use the Raw Data Editor, because I know coding and so I could use the Ctrl + F11 to make things faster after doing it once on a Trigger, I just can't put it from the Ctrl + F11 back onto my game.
EDIT: Can someone point me to a working guide where it shows you how to add skills onto units? I want it to be like WC3 Custom Maps status where you "buy" a skill from a shop.
Also, how do I test a map with friends or do I have to publish onto B.net v2.0?