• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Inquiry] Lesson 12

Status
Not open for further replies.

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
/*
* Create a footman for Red with facing 185 at 1.5, 3.5
* Display that unit's name, point value, and facing
*
* PrintInteger(integer) //user-defined function
* PrintReal(real) //user-defined function
* Print(string) //user-defined function
*
* CreateUnit //native
* //can't be used in declaration
*
* Player //can be used in declaration
*/

//! runtextmacro Variables()
set player red = Player(01)
set integer foot = 'Hfoo'
set real angle = 185
set real x = 1.5
set real y = 3.5
//! runtextmacro Actions()
CreateUnit( red, foot, x, y, angle)
Print(GetUnitName(GetLastCreatedUnit()))
//! runtextmacro End_Code()

it doesn't work, no unit created on map, and no name printed..... :(
 
Then you did not enable the trigger, because that thing is not supposed to compile either way.

Everything between //! runtextmacro Variables() and //! runtextmacro Actions() should be variable declarations.

Also, you have way too many declarations here :v
Plus, you forgot the "call" keyword.
You need it.

Don't use variables if you don't need them.
You should only use 1 variable here.
You don't need variables for the coordinates because you don't need to have them stored. You can use the values directly.
 

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
hum yes i probably forgot to tuen on the trigger Lol
call Print i see...
thanks
 
Status
Not open for further replies.
Top