HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

keeping track of spell lvl for custom spells

05-31-2003, 01:27 PM#1
Ultramagnetic
What's a good way of going about this?

Would I do it in the actual triggeR? Or is it done through variables?

I don't really even know where to begin on this
05-31-2003, 02:54 PM#2
COOLer
I would just do a trigger spell if i where you but
or
event
----------------------
unit owned by (what ever player you want) learns a skill
-----------------------
action
-----------------------
set (your varable )=learned skill level


its that easy!
You can also have a condtion to check to see what spell is being used!
05-31-2003, 05:09 PM#3
Ultramagnetic
I am gonna do a trigger spell, but I need a way for it to be able to detect all 3 lvls of it so it can do what it's gotta do.


Hmm. Would it be possible to put the actions and conditions in the same trigger? Or would I need atleast 2? One to carry out the actions and one to detect lvl?
05-31-2003, 06:28 PM#4
COOLer
Yep 2 triggers

just you on your second trigger to find what level skill your unit is.
06-01-2003, 01:17 AM#5
Ultramagnetic
okay, but wouldn't I need to make 3 different triggers for each 'extra' effect my enhanced spell has? Like say I want to summon 3 different units that do three different things acording to lvl.... Would I need 3 different triggers, or could I acomplish this with if/then/elses?
06-01-2003, 03:27 AM#6
ChoboMapper
i use if then elses for my jass levels, works fine
06-01-2003, 04:04 AM#7
Ultramagnetic
Okay so I need the one trigger that detects when the hero learns the skill, then another filled with if/then/elses that actually carries out the extra actions it needs to right?

How would I actually set this up? I almost get it, but not exactly...

Trig:

e: Unit owned by player x learns skill = to blah

c: unit-type of triggering unit = blah

a: ??? What do I do here? Set a variable? This is the part I can't figure out yet. What actually detects the level of the spell?


do I even need to bother with a trigger like this if I use if/then/elses though?
06-01-2003, 06:16 AM#8
Dead-Inside
You can do If / Then / Else like this:
If triggering unit equals to Blah do set HeroLvlGain[1] = HeroLvlGain[1] + 1 else do nothing
You should set the heros at the beginning to a variable, this way you only need one trigger with If Then Else's to check all heros level gain.
For the next players hero it will be HeroLvlGain[2], and onwards.
HeroLvlGain is an integer array. Arrays are used to store multiple variables in one, under one name and then accessing them by a number, 1 to 1024 (Max limit).

Regards
Dead-Inside
06-01-2003, 10:15 AM#9
Ultramagnetic
Dead-Inside, you might not be understanding what I'm tryin' to do here.


I don't want to detect when a hero gains a lvl, but rather when a hero puts a point into a particular skill, so I can make the enchanced spell triggers for that spell recognize what lvl it currently is, and do what they got to do for that specificlvl of the spell.
06-01-2003, 11:14 AM#10
kharma
Create an integer variable. I've called it 'monkeyface', but you can obviously call it something more relevant :P. Then setup the following triggers:

Trigger 1: Tracking the skill level-

Events: (Player owned unit event)
Unit - A unit owned by *Player* learns a skill
Conditions: (Hero Skill Comparison)
(Learned Hero Skill) Equal to *Your custom spell*
Actions: (Set variable)
Set monkeyface = (Learned Skill Level)

Trigger 2: Modifying the enhancement based on the skill level-

Events:
*Your custom spell detection Events*
Conditions:
*Your custom spell detection Conditions*
Actions: (If/then/else)
If (monkeyface = 1) then do (Action for level 1) else do (If (monkeyface = 2) then do (Action for level 2) else do (If (monkeyface = 3) then do (Action for level 3) else do (nothing)))

If your custom spell needs more then one action for each level, simply set all the actions for each level in a different trigger, then replace each (Action for level #) with their corresponding run trigger. Quite obviously, this is a much easier task in JASS, since you can put multiple actions under each if case. There are a number of ways this could be done, I simply choose the first that came to mind. I kept it to basic GUI triggers so everyone could understand it. The whole concept is very easy to shift to JASS.

~kharma
06-02-2003, 08:00 AM#11
Ultramagnetic
Quote:
Originally posted by kharma
(Learned Hero Skill) Equal to *Your custom spell*



Okay, but it doesn't seem to want to let me pick my custom spell out of there. I can only pick presets. Can I Actually do this? Or do I have to pick the spell it was based off of? And if that's the case then how do you get this method to detect spells that're based off of unit abilities that've been modified into hero ones?
06-02-2003, 10:30 AM#12
kharma
Sorry, I thought you might've realised. First you need to set up the trigger with one of the normal spells, then simply convert to custom text and replace the 4-letter spell code that appears in the text with your own 4-letter code for your custom spell. If you're worried the trigger may not work properly in the testing phase, make a copy of it before you convert it to custom text.

~kharma
06-02-2003, 11:01 AM#13
Ultramagnetic
Ahhhhh, I get'cha now. So it doesn't matter exactly what spell I set it up with so long as I change the code to my custom code afterwards right?
06-02-2003, 11:16 AM#14
kharma
Yes that's correct.

~kharma
06-03-2003, 12:20 AM#15
Ultramagnetic
okay - update:

I have it working now, BUT it always somehow seems to be a lvl behind.

My spell is set up like this

Trigger 1:

JASS trigger: Detects when the spell is cast using the mana-check system, when the conditions are met, it activates....

Trigger 2:

GUI TriggeR: The LvL checker. Filled with only 3 if/then/else actions that're set up to detect the lvl of the spell, then run the corresponding actions for it (Which are all in seperate triggers themselves)

Trigger 3:

GUI Trigger: When the custom spell is learned it sets the integer variable to ="last learned spell", using it's custom code.


somehow everything seems to be a lvl behind though. LvL 1 works fine, but then LvL 2 runs the lvl 1 actions, and LvL 3 runs the lvl 2 actions. Could it be that I need to be setting the variables . SpellLVL[X] + 1 = whatever?