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

[JASS] How do you install custom jass scripts

Status
Not open for further replies.
Level 3
Joined
Mar 27, 2004
Messages
70
Depends on the Jass script you want to "install".
Most of them needs to be copy/pasted into the map header*.
After that you need to use the Custom Script action to call its main function, but then again it depends on the script, and there is no standard way of doing it.
Note that some of the Jass scripts here are simply a trigger converted to custom text (quite poor Jass), and those require that you make a new trigger, convert it to custom text and replace the custom text with the Jass script.

If point out which Jass scripts you need help implementing I may be able to help you more.

*To open the map header, click the topmost item with the map's name in the trigge editor.
 
Level 3
Joined
Mar 27, 2004
Messages
70
Okay, copy both scripts into the map header.
To use UnitGuardUnitAI, make two unit variables. I call them Guard and GuardMe. Store the unit to be guarded in GuardMe and the one to guard it in Guard.
Then do like this:
Code:
set Guard = (..)
set GuardMe = (..)
Custom Script: call UnitGuardUnitAI(udg_Guard, udg_GuardMe)
Fell free to change Guard and GuardMe afterwards.

The waypoint system is difficult if you don't know jass yourself.
First you need a trigger that runs on map initialization. This trigger will create all the waypoints. Call it InitWaypoints.
Convert it to custom text, then you define your waypoints like this:
Code:
// Keep in mind the order of the waypoints
// (The numbers are x,y coordinates)
call NewWaypoint(0,0) // #0
call NewWaypoint(12000, 5100) //#1
call NewWaypoint(-1500,0) //#2
// ...

// Now connect them
call ConnectWaypoints(0, 1) // Connects waypoint #0 and #1
call ConnectWaypoints(1, 2) // ..
It takes some time writing that, just change the numbers in the parantheses to change the coordinates. You can create much more than 3 waypoints of course.

Now, to make a unit go to a certain waypoint. You must remember the number of your waypoint (the first waypoint is #0, the next is #1 and so on).
Make a variable called UnitFollowWP, and set it to the unit you want to go to a waypoint.
Code:
set UnitFollowWP = (..)
Custom Script: call UnitGotoWaypoint(udg_UnitFollowWP, 0, true)
Change the "0" in the custom script to the number of the waypoint he should go to.
If you change "true" to "false" the unit will move instead of attack-move.

I probably lost you somewhere, so just ask if you need more help.
 
Status
Not open for further replies.
Top