• 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.

Project 1.....

Status
Not open for further replies.
Level 2
Joined
Sep 16, 2013
Messages
12
/*
* Create
*
* 1 Player variable for each player
*
* Name them using the variable type of the variable + *id* of the player
* Player Red would be Player 1 *in-game*.
*
* Players
*
* red
* blue
* teal
* purple
* yellow
* orange
* green
* pink
* grey
* light blue
* dark green
* brown
*
* 1 rifleman for red
* 3 footmen for blue
* 1 knight for teal
* 1 paladin for purple
* 1 ghoul for yellow
* 2 peasants for orange
* 2 acolytes for green
* 1 grunt for pink
* 1 arch mage for grey
* 2 mountain kings for light blue
* 1 blademaster for dark green
* 1 gargoyle for brown
*
* all at 1.5, 2
*
* Afterwards, run the map and see if you can win
*/

//! runtextmacro Variables()
//! runtextmacro Actions()
//! runtextmacro End_Code()
//! runtextmacro Project1()

1. When I enable the trigger it says I need some initTrig function?
2. what is runtextmacro supposed mean? Why is there an exclamation mark after the //?
3. Where am I supposed to declare the variables? I fiddled around and found I could only declare them between the runtextmacro lines

I'm just really confused and I have no idea where to start.
 
When I enable the trigger it says I need some initTrig function?

Ignore that.

what is runtextmacro supposed mean? Why is there an exclamation mark after the //?

It's a preprocessor directive. We're using it to hide all the code that runs in the background other than yours.

JASS:
//! runtextmacro Variables()
//Your variables go here.
//! runtextmacro Actions()
//Your code goes here.
//! runtextmacro End_Code()

Example:

JASS:
//! runtextmacro Variables()
integer i = 0
integer j = 0
//! runtextmacro Actions()
set j = i + 3
//! runtextmacro End_Code()

Where am I supposed to declare the variables? I fiddled around and found I could only declare them between the runtextmacro lines

Precisely.
 
Level 2
Joined
Sep 16, 2013
Messages
12
ok I see. Thanks.

It seems I didn't pay attention to the textmacro surrounding the big "CREATE VARIABLE HERE" comment when doing the exercises.
 
Status
Not open for further replies.
Top