wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Tutorials > Tutorials for beginners
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 01-08-2006, 12:18 AM   #1
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default JESP Spell implementing tutorial

Implementing JESP Spells

Table of contents

I. Introduction
II. Copying objects
III. Implementing needed functions/systems/variables
IV. Copying the spell trigger and changing rawcodes
V. Configuring the spell
VI. Configuring eyecandy
VII. Final notes

I. Introduction

This document will give you detailed information about how to import and configure JASS spells.

It is mainly written for spells that follows the JESP Standard, since the standard makes implementing/
configuring the spells easier, and more the same. An amount of the instructions written here will also
be the same for importing regular JASS spells, depending on how much they reminds of JESP spells.

Before implementing ANYTHING into your map save a backup of it. If you do some wrong, you can just pick
up the backup, save another backup and try again. Else you can risk losing your map.

NOTE: If something isn't working or you gets errors when saving your map, try again.
If it still doesn't work after that, try to contact the author of the spell map and ask him/her for
help with implementing it or ask in the forums (I suggest trying to contact the author first).

II. Copying objects

This can take some time depending on how many objects the spell needs, but it is probably the simplest
part of implementing a spell.

Open the Object Editor, click on the 'Abilities' tab, select the spell and press CTRL+C or click on the
copy button. Open the map you want to implement the spell into and press CTRL+V or the paste button.

If the spell needs additional objects so as buffs, dummy units or dummy spells, copy them too.
The procedure is the same.

If the spell itself or any dummy spells uses buffs, or if you have dummy units that have custom
abilities, those fields will most likely point to something else than in the original maps.

You can read more about the reason of that in rawcodes part of this document.

Now simply just make sure that those fields points to the correct objects.

III. Implementing needed functions/systems/variables

If the spell needs any extra functions, systems or variables to work, those needs to be implemented
before thespell itself. The spells header/a read me in the map should tell you which
systems/functions/variables it needs and where to find and how implement them.

Some spell makers have, however, not done so. If they haven't and you can see that the spell(s) uses
custom functions or if you keeps getting errors after implementing the spells.

So if a map needs extra functions or variables and there is no instructions, try the following, it will
hopefully work:

A) Copy Variables
Copy all variables from the map containing the spell(s) you want to the map you will implement them
into.

The easiest way to do this, is to create a GUI trigger, make it uses all variables (how and when the
trigger uses them does not matter).
Then go to File --> Preferences in the World Editor. Under the 'General' tab, check the
'Automatically create unknown variables while pastin trigger data' box.

Then select the trigger you just created, press CTRL+C or click on the copy button. Then open your map,
press CTRL+V or click on the paste button. Now when the trigger is pasted into your map all the
variables are automatically created for you. Then delete the trigger, you won't need it anymore.

B) Copy 'Custom Script'
Custom Script is another name for JASS, the scripting language used for WarCraft III.
At the top of the trigger list, there is a blue map icon with the name of the map file.
If you click that you will be taken to the maps custom script section.

A function is a block of text that basically looks like this:

Collapse JASS:
function <functionName> takes <parameterList> returns <returnValue>
    //<actions, eventually a return statement>
endfunction

Note that the block of text can start with 'constant function' instead of just 'function'.
We won't go into detail with functions now, but look at the functions name.

If you have implemented other functions in your map already, ensure that none of the functions in the
spell map are identical to (has the same name) as any functions already in your map's custom script
section.

Copy all functions you do not already have into your map's custom script section and save the map.

NOTE: Needed functions are often in seperated triggers. People that does so will most likely also take
the time and say that the spells needs X function which can be found in Y trigger.
They will most likely also give implementation instructions in that trigger.

If they haven't done so, the procedure is the same check that you don't have functions with those names
in your map already, if you don't have, copy the functions to the Custom Script Section. Do NOT just
copy the trigger.

When the function(s) is/are in a trigger, there may also be a function called:

Collapse JASS:
function InitTrig_<TriggerName> takes nothing returns nothing

Never implement that function. (You can copy that function but it will be useless and may cause conflicts later)

NOTE: Some exceptions are systems like the caster system in those cases it is better to implement them from their official map (The caster system has a map with full instructions about how to implement them)

IV. Copying the spell and changing rawcodes

Now it is time to copy the spell trigger itself. That shouldn't be too hard, just select the spell,
press CTRL+C or click the copy button, open your map and press CTRL+V or click on the paste button.
Save the map.

Now it's time to change rawcodes of the spell and other objects used by the trigger.

But, what is a rawcode?

A rawcode is a four letters long code. Each object (everything found in the Object Editor are objects)
have an unique rawcode. Because of that, rawcodes often changes when you copy an object from one map
to another.

When a spell follows the JESP Standard, you only have to write the rawcode of an object once.

That will in almost every case be in a configuration function looking like this:

Collapse JASS:
constant function MySpell_SpellId takes nothing returns integer
    return 'XXXX'
endfunction

the constant word doesn't forcefully have to be there, and the function will most likely also have another name.

The only important thing in that function is the rawcode, in this case XXXX.

You must replace that with the rawcode of the spell in your map.

To do so, open the Object Editor, select the spell and press CTRL+D or check 'Display values as raw
data' in the view menu.

Now the name of the object has changed to "xxxx:yyyy (Object Name)" if it's a custom object or just
"xxxx (object name)" if it isn't a custom object. It will in most cases be a custom object though.

In both cases it is the 4 letters marked as xxxx here that is the rawcode, so put them into the
configuration function instead of the code that was there before.

Note that rawcodes are case sensitive so A00P is not the same as a00p.

Do this with all objects the spell's trigger wants.

V. Configuring the spell

For a spell to follow the JESP Standard, it must have a header of functions used to configure it.

Those functions are used for various things, that can be everything from spell damage and AoE, to which
and how many units to hit.

Collapse JASS:
constant function MySpell_Damage takes real level returns real
    return 25*level
endfunction

Note that the word constant is not always there.

This function takes a real argument called 'level' and returns another real value, which will be used
by the spell scripts to deal damage.

It can also take other arguments, arguments of other types, next is a short introduction to the most
commonly used variable types by configuration functions.

integer - An integer is a number without decimals. Rawcodes are integers too.
Examples of integer values: 1, -27, 'A005'.

real - A real is a number with decimals. Normally you can use integers as reals directly, but that is
not possible in return statements == configuration functions.
If you multiply an integer with a real (or the opposite) it will return a real value.
If you only have integers in your function, try to put a . behind it (no decimals are actually
needed, just the dot, the game will add a lot of 0 decimals then) or use the I2R function.
Examples of real values: 0., -1435.98, 0.27.

string - A string is simply text between quotes. If you have quotes in side the string, put a \ before
it, else you will get errors when saving (the \ character won't be displayed in game).
If you want a backslash in the string, for example if it's a filepath, use two backslashes
instead, the first one is only used for control.
Examples of string values: "Hello World!", "Bob \"Teaspoon\" Johnson", "Textures\\gutz.blp".

boolean - A boolean value is either true or false. Nothing else. Examples aren't really needed.

That is the most common values used by configuration function. Many functions takes an argument called
'level'. That is, of course, the level of the spell, and can be used for calculating stuff.
It is sometimes an integer and sometimes a real, depends on the type the function will return. If it is
a real, it will always just be the integer with 0 decimals added.

The functions will most likely have descritive names and/or comments explaining what they do.
Just change the returned values to edit it, don't care about the rest.

VI. Configuring eyecandy

If you want to change the eyecandy of a JESP Spell, it can often be done in the Object Editor, on the
spell itself.

The author will hopefully have written from which fields in the Object Editor that certain values are
extracted from, but if he/she hasn't, the easiest solution is to look at the spell in game, find the
effect you want to edit, open Object Editor and check all values untill you find the one that is
equal to the ingame effect and change it.

NOTE: The filename in object editor must end with .mdl, sometimes the editor doesn't automatically add
that extension. If that is the case, just add .mdl to the file name manually.

If the value isn't extracted from Object Editor, it is the spell script itself. Simply find the
configuration function where it is, and change it. To get the path of another model, you can simply
set a model used in Object Editor to that model, press ok, open the field again, and select the value
in the 'Custom' field. Copy it to the function, replace all single backslashes to double backslashes
and ensure that it ends with .mdl. As it is a string, it must be within quotes.

Example:

Collapse JASS:
constant function MySpell_Effect takes nothing returns string
     return "Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl"
endfunction

VII. Final notes

This tutorial hopefully cleared out some things, and you should be able to implement spells and
configure them so they fits your needs.

If there was something you didn't understand, read it again. If that doesn't help, try to ask in the
forums at Wc3Campaigns (http://www.wc3campaigns.net) or The Jass Vault (http://www.wc3jass.com) or
contact the author.

Thanks for reading!

NOTE: I've added a small map that contains this tutorial as a trigger, so you can copy-paste it into your spells maps instead of linking people to this.
Attached Files
File Type: w3m JESP Spell Implementing Tutorial.w3m (16.3 KB, 168 views)
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-08-2006, 09:37 PM   #2
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default

Update: Added a map file with this in trigger form (other formatting) so that it easily can be included in spell maps.
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Old 02-11-2006, 09:01 AM   #3
Ooohshiny
User
 
Join Date: Feb 2006
Posts: 11

Ooohshiny has little to show at this moment (4)

Default

Blade.dk er du dansker?
Ooohshiny is offline   Reply With Quote
Old 02-13-2006, 06:33 PM   #4
PhoenixFeather
User
 
PhoenixFeather's Avatar
 
Join Date: Dec 2005
Posts: 151

PhoenixFeather has little to show at this moment (7)

Default

Yes he is, so am I, but this an English forum...
__________________
Mostly inactive due to final exams...
PhoenixFeather is offline   Reply With Quote
Old 03-01-2006, 04:29 PM   #5
Ooohshiny
User
 
Join Date: Feb 2006
Posts: 11

Ooohshiny has little to show at this moment (4)

Default srry

is there some danish forums or are u member somwhere else?
i did'nt know tht we only were supposed to write english in here so srry
Ooohshiny is offline   Reply With Quote
Old 03-05-2006, 07:58 PM   #6
Jacek
Banned
 
Join Date: Dec 2004
Posts: 1,095

Submissions (1)

Jacek is a jewel in the rough (164)Jacek is a jewel in the rough (164)

Send a message via MSN to Jacek
Default

Well... you can speak whatever language you want in PMs without problems...
Jacek is offline   Reply With Quote
Old 03-05-2006, 08:07 PM   #7
Blade.dk
.
 
Blade.dk's Avatar


Respected User
 
Join Date: May 2005
Posts: 1,990

Submissions (15)

Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)Blade.dk is a glorious beacon of light (418)

Approved Map: Azeroth's Arcane ArenaSpell session 01 winner

Send a message via MSN to Blade.dk
Default

As far as I know there are no danish wc3 forums, and if there were then I would not visit them, as they most likely would suck because of too few members.

Please stay on topic from now on.
__________________
Spell Making Course: Part 1: Making a simple stomp spell.
I wonder if I'll ever finish part 2.
Blade.dk is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 02:36 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services