HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need Help With a Math Trigger

08-27-2008, 02:03 AM#1
Zero
I'm trying to create a trigger that says:

Event:
Unit Gains Level

Condition:
Level of (leveling unit) equal to multiples of 5

Then, fire trigger.

Help plz ;)
08-27-2008, 02:31 AM#2
Ammorth
Condition:

Modulo ( Hero Level , 5 ) is equal to 0 modulo returns remainder, so when it is completely divisible by 5, it is a multiple.
08-27-2008, 02:51 AM#3
Zero
Alright, I get it. Thanks it's working!
08-27-2008, 07:05 AM#4
Zero
Ok... I've ran into another problem. The trigger works fine if the Hero only gains a single level, but if the Hero gain's enough EXP to gain multiple levels this trigger doesn't work.

This is what the trigger looks like:




I tried adding in a For each integer from 1-500 seeing as their is 500 levels but that didn't work. I also tried the same thing but with 1-10.

I know I'm missing something small, but I need it to function exactly the same way if the hero gains multiple levels at once or I can't have quest givers award EXP for quests and that's just dumb.

So, what am I doing wrong
08-27-2008, 02:06 PM#5
Anitarf
You're awarding too much exp at once, you can always try awarding quest exp in smaller chunks.

It's either that, or a more complicated skill point trigger.

...isn't there an option in gameplay constants that lets you modify each how many levels a hero gains skill points?
08-27-2008, 04:25 PM#6
ToukoAozaki
1. Store hero's level at birth (level 1). You can use any applicable method to store the data.
2. On lvlup trigger, perform a for-loop from (previous level+1) to (new level) and check those levels for any condition you need to check.
3. On the last part of the trigger, update the stored level.

Quote:
Originally Posted by Anitarf
...isn't there an option in gameplay constants that lets you modify each how many levels a hero gains skill points?

I thought there was, but I can't find it anyway.
08-27-2008, 06:12 PM#7
Zero
Ok, so Touko's trigger looks like:




But, this doesn't work and he's offline @ the moment... This trigger always removes a skill point and never lets u have one.

Help?
08-27-2008, 06:52 PM#8
Ammorth
You have 2 Players_Level in the loop.

Also, there are gui tags you can use. Right-click the name of your trigger, select copy as text, and then use [trigger] and [/trigger] tags. Looks like this

Trigger:
Test Trigger
Collapse Events
Map Initialization
Conditions
Collapse Actions
Do Nothing
08-27-2008, 07:23 PM#9
Zero
Ok fixed and solved the problem and works fine:

Trigger:
Removing Ability Points
Collapse Events
Unit - A unit Gains a level
Conditions
Collapse Actions
Collapse For each (Integer A) from (Players_Level[(Player number of (Owner of (Leveling Hero)))] + 1) to (Hero level of (Leveling Hero)), do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Integer A) mod 5) Not equal to 0
Collapse Then - Actions
Hero - Modify unspent skill points of (Leveling Hero): Subtract 1 points
Collapse Else - Actions
Do nothing
Set Players_Level[(Player number of (Owner of (Leveling Hero)))] = (Hero level of (Triggering unit))

Thanks for the help guys ;)