Wednesday, April 18, 2012

Having trouble with my ability learning system

Hey all, my problem here is that the ability learning system i've devised doesn't work and i can't think why.

Here is an example, perhaps someone could shed light on the problem?


Code:
Warrior Levelling
Events
Unit - A unit Gains a level
Conditions
(Leveling Hero) Equal to Warrior
Actions
Set WarriorLevel = (WarriorLevel + 1)
Wait 0.01 seconds
If (WarriorLevel Equal to 3) then do (Unit - Add Last Stand (WARRIOR) to Warrior) else do (Do nothing)
Wait 0.01 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WarriorLevel Equal to 5
Then - Actions
Unit - Remove Dodge (WARRIOR, rank1) from Warrior
Wait 0.01 seconds
Unit - Add Dodge (WARRIOR, rank2) to Warrior
Else - Actions
Do nothing



"Warrior" and "WarriorLevel" are both variables, their original values are declared at map initialisation.

Any ideas?|||You have wasted pretty much memory and time doing this, and using many variables etc usually enables you to do mistakes making it not work.

I'll give you an easy exampe you may like more:

1. No Variables Needed

2. No Useless Waits

3. Easy to copy-paste and then modify level/ability

4. Easy to your eye / doesn't look confusing

5. Works faster than your current trigger

6. Hope I helped, if not then reply


Code:
Warrior Levelling
Events
Unit - A unit Gains a level

Conditions
(Triggering Unit) Equal to Warrior

Actions

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Triggering unit)) Equal to 3
Then - Actions
Unit - Add Dodge Last Stand (WARRIOR) to Triggering Unit
Else - Actions
Do nothing

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Triggering unit)) Equal to 5
Then - Actions
Unit - Remove Dodge (WARRIOR, rank1) from Triggering Unit
Unit - Add Dodge (WARRIOR, rank2) to Triggering Unit
Else - Actions
Do nothing

Oh, forgot to mention why I used If Then Else Multiple Actions instead of a single; well if you want to add a condition or more actions you have to start over again if you use a single action. With if then else (multiple) you can "Show/Hide" which is good to have if you want more than 3 if then else in one trigger, which you probably will use if you want a hero to have more than 3 abilities :)|||Wow, i could totally hug you right now! You have no idea how long i've spent trying to get a good working ability progression!

But now from one problem to another lol, and i'm serious, this one is completely mind boggling. I have an instant Hero Revival system that "worked" perfectly. But as soon as i modified my ability learning triggers the revival system stopped working. Completely. I can't figure out how just writing a trigger for something else can do that.

This is my current revival trigger;


Code:
Warrior Revive
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to (warrior)
Actions
Hero - Instantly revive (Dying unit) at (Center of Reset Return Point <gen>), Show revival graphics



I have tried fixing it, i've used both Condition - Unit-type comparison and Condition - Unit comparison (using the Warrior variable). I've also used both Event Response - Dying unit and Event Response - Triggering unit.

Nothing works. This is quite possibly the most confusing thing i've ever seen! Can you help? |||Oh god I wrote a long reply and then accidentally pressed on a link here so I have to start over again xD

and now I'll make it short but good ;)


Quote:




Wow, i could totally hug you right now! You have no idea how long i've spent trying to get a good working ability progression!




Glad I could Help

Now I made a map using your trigger and your name of hero and region, although the strange part which I've never seen before is that your warrior's name is " (warrior)" = 3 blanks then warrior inside brackets.. quite strange name for a hero :P

But I guess that's how you want it so I made mine with the same name and made some units killing him, and he revives at the "Reset Return Point" <gen> perfectly (<gen> means that you've made it in the tool palette) so, A unit dies - works, unit type o dying unit - works, revive dying unit - works, center of reset return point - works.

1. Download the map I made for you (it's only 17 kB)

2. Basically this is the best tip I have to fix your problem which usually works :) , Delete your trigger and re-do it (this takes you 30 seconds - 1 minute) and will 100% fix your problem, if you want to see if you've done it wrong before or if it's World Editor's fault [bugs happens..] then save your trigger and make a new one instead and compare them and see if it's any mistakes somewhere.

Link to the map which uses your system (which works): http://oihjqg.blu.livefilestore.com/...r.w3x?download ( I uploaded it to my hotmail since it didn't work here in the "attach files" )

3. Hope this helped else something is wrong with your unit {can be that it's a Unit and not a Hero cause then you can't use "Hero - Revive (instantly)" }|||Thank you for taking time to help me, i really appreciate it. Only your link wont work for me, comes up with the error page saying; "Oops! This link appears to be broken."

My heroes name i did on purpose, the blank spaces are the actual name and the "(warrior)" is an editor suffix. The hero has "Warrior" in it's list of actual names. I did this so that in game it appears named as Warrior then on the experience bar it just says "Level #", instead of if i had called the unit Warrior it would say "Level # Warrior", know what i mean?

As for my revival system, i left the unworking triggers enabled but implemented an "alter" revive too, just modified it to be free and take 1 second. Here comes the part, after you have used the alter to revive at least 1 hero, the instant revival triggers start working again for all heroes, regardless of which one you revived at the alter. The triggers will not work unless you have used the alter at least once.

I deleted and re-wrote the same triggers and still same effect. I will give you a whole bag of cookies if you can solve that. |||Oh the link you're roght about.. No idea why it stopped working but nevermind that now :)

I don't really know why your trigger disables/enables when you revive a hero in the altar, although it may be something creepy in the "Hero: Requirements/revive/dependencies" somewhere far down in the object editor :P I'd only guess cause this is the only thing that affects heroes' revival as far as I know.

But then again finding world editor bugs is alot harder than your own ones xD

Good Luck|||Bit of a late post, but try changing your event into "Unit becomes revivable" and the first part of your condition into "Unit Type of(Revivable hero)". Figured this from how in a normal game there is a small delay after your hero dies before you can revive him from the altar.

If this works, it might cause that same small delay for your map, but does that matter?

No comments:

Post a Comment