custom hero problem

exge

New Member
Reaction score
15
i looked at acehart's custom hero map where you select the skills for the heroes, but i do not understand the game caches part .. ace .. will you kindly explain to me the game caches and how they are used in your map...
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Well, the Heroes in the center have Channel 1 to 3 and Channel U as abilities.
Those are replaced, later on, with a version of Engineering Upgrade.

When you select a Hero:
He's moved to your start location,
he's hidden,
you get a Dummy Hero with a choice of Channel abilities to choose from.
If you use one of those abilities, the real, and hidden, Hero gets the corresponding Engineering Upgrade.
After three clicks, the Dummy Hero is replaced with yet another Dummy, with a selection of Ultimate abilities.
...


Now, when you click on, for example, "Channel Chain Lightning",
the trigger needs to find out what Engineering Upgrade to use.
And, if you look at the "Tables" triggers, there's an array with all abilities.

Originally, there was an array too for the Channel spells.
Which meant a loop, from 1 to 79 or so, to find the Channel ability in the list,
and use that index with the Engineering array.

Example, "Chain Lightning".
Would mean to look through the Channel abilities, until you find "Channel Chain Lightning".
You would find it at index 10 in that array.
Then you know that you need to use whatever ability is in the Engineering list, at index 10.
Which happens to be "Engineering Chain Lightning".

However, with a large list of abilities, looping through the array is very slow.
Slow to the point where you get lag, even single player.

Which is why the trigger stores the indexes in a game cache, with the name of the ability.
When needed, it will simply ask the gamecache: "What index you have for Channel Chain Lightning?".
And it instantly gets the reply: "10".
No looping anymore. Spell replacement is instant.
 

exge

New Member
Reaction score
15
ahhh .. i see .. so i have to use engineering upgrade for all my abilites ( the dummy ones)
??

EDIT:i used your map as a reference but i got funny results .. ( dont flame me or anything but my version really looks like @#$$% ) mayb you could help me see what went wrong

ps : i prefer to learn by doing , not cnp the while triggers in ...

see attached file for the whole map...

thanks alot
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> I used your map as a reference but I got funny results

I like funny :p

> Set Engineering[1] = Entangling Roots
> Game Cache - Store 0 as (Name of Root ) of Setup in (Last created game cache)

You would have greater success with "Store 1" instead of 0.
There is no ability in "Engineering[0]", but there is one in "Engineering[1]"...


Ever had a detailed look at the Tinker Hero?
He has, for example Cluster Rockets.
Now, if you look at Cluster Rockets in the Object Editor, you'll notice there's 4 different versions of it.
Cluster Rockets, the ability he starts with, to learn and use.
Cluster Rockets Upgrade 1, and Upgrades 2 and 3.
If he learns Engineering Upgrade, Cluster Rockets will be replaced with Cluster Rockets Upgrade 1.
If he learns it one more time, Upgrade 1 will be replace with Upgrade 2.
And, if Engineering Upgrade replaced and ability and is then removed, your Hero will get the original ability back.

Engineering upgrade has:
Data - Ability upgrade 1: Previous ability, New ability.


In my demo map, all Heroes start with Channel 1, Channel 2, Channel 2 and Channel U.
1-3 for the basic abilities, and U for Ultimate.

Let's take, for example, "Bash".

There's an ability called "Channel Bash".
It isn't doing anything, besides providing an icon and a tooltip.
There is "Engineering Bash", which would replace "Bash" with "Channel".
There is, in TablesChannel:
Game Cache - Store 2 as (Name of Channel Bash ) of Setup in (Last created game cache)
and in TablesEngineering:
Set Engineering[2] = Engineering Bash


If you use "Channel Bash",
your Hero gets "Engineering 1", which replaces "Channel 1" with "Channel".

He gets "Engineering Bash", which replaces "Bash" with "Channel".
The Hero already has "Channel", so nothing will happen.
Finding "Engineering Bash" means asking for the index of "Channel Bash" (gamecache), and using that value as index into the engineering table.

Once done, "Engineering Bash" is removed.
Since it assumes it replaced "Bash" with "Channel", and the Hero actually has "Channel",
it will undo that change, by replacing "Channel" back with "Bash".
An ability the Hero never had, but that's the entire point.

After that, it also removes "Engineering 1".
Originally, it replaced "Channel 1" with "Channel".
Now though, our Hero has neither "Channel 1" nor "Channel", so nothing will happen.

The end result:
Hero started with "Channel 1", Hero ends with "Bash".


The rest is bit of triggering that makes sure the first time it replaces "Channel 1", then "Channel 2" on the second, and "Channel 3" on the third click.
It then replaces the current chooser Hero with a new one that offers the Ultimate choices.
Which will replace "Channel U" on your actual Hero.

Once done, the chooser Hero will disappear, the newly configured Hero is unhidden and given to the player.



Actually, my guess would be there's a slightly easier way with Spell Books and Engineering Upgrades.
Never tried it though.
There was no Spell Book back then... :p

Anyway, I hope this makes the map mechanics a bit clearer.


> don't flame me

Why would I?

The Tinker used to be my all time favorite neutral Hero.
Until about after that map... since then, I've seen enough of Engineering Upgrade...
 

exge

New Member
Reaction score
15
well thanks ... now i fully understand it .... sort of

why would you??

i wasnt referring to you :p cos some people may call me a noob and such for not knowing such basic stuff....
i admit .. i am noob at gamecache .. and tables :shades:

EDIT: now it works fine .. except for 1 funny problem ... once the hero is given the ulti spell, it screws up ... and im back with 2 channel dummy abilties ....
hope i didnt trouble you too much ...

new attached file

also you said it could be done with a spellbook too, can you show me how ... cos i think it will be easier thanks again
 
Y

Yarid

Guest
I know this is a bit of an old topic (4 days, eek!) but I was searching through the forums trying to find how to make a custom hero map and found this topic, which sent me looking for the above Custom Hero map... so since it helped me, let me see if I can answer the question about spell books.

http://www.thehelper.net/forums/showthread.php?t=40907

That thread has the basics, but from what I can see, you make a new custom ability from the Item spell, Spell Book. Under Stats- Item Ability, you uncheck that, so it says False. Under Stats- Hero Ability, you check that, so it says true. No need to do that if you'll only have one level of Spell Book, but I'm going to try to apply it so that it does the first few (AceHart does 3, I'm giving my heroes 4) skills, and then the ultimate. To do that, I'll have Spell Book be a Hero Skill with two levels, the first having all my basic skills, the second having my ultimates.

Now, from as near as I can tell, an ability cast from a spell book is exactly the same to the World Editor as an ability cast normally. So add your channel spells to the spell book and then add your triggers to give the hero the engineering upgrades.

The largest benefit I can see for this method, so far, is that a hero only has, what, 12 button spaces total? A spell book holds more. I stopped counting at 15.

Hope this helped!
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
You need a line like this:
Game Cache - Store 1 as (Name of Engineering Tranquility ) of Setup in (Last created game cache)

Otherwise it will not find the ultimate in either the cache or the ability array.


Don't disable the Engineering Upgrade, remove it instead.


Your custom value logic is faulty.
Start at 0.
Add 1 at the start of the "then" actions.
And change the test to "3".

Which also means you can remove the init trigger that sets the custom value to 1.


Please warn people when you use WEU for a "game - display"...
No one likes to see his editor crash!


> I stopped counting at 15.

You should stop at 11 though.
There's no room to show any more.
And you need one for the "cancel" button.
 
Y

Yarid

Guest
Ah. The editor (either WEU or WE, I'm not sure whether it's a built in function or a WEU one...) will apparently let you add more than 11 abilities to a spellbook. I didn't test to see whether you could make layered spell books; that is, whether you could add a spell book with spell books as abilities, to let you add more and actually see them.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
If you set, for example, minimum spells to 3, maximim spells to 7 and add 10 spells to the book,
every time you start the game, it will have 3-7 spells, randomly choosen from the 10 available...


And, yes, you can have spell books inside spell books.
Assuming they use different "Data - Order ID"s.
Preferably also different from any spells inside.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top