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

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