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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top