|
Thread: Heroes 4 Advanced Options Map Editor | This thread is pages long: 1 2 3 4 5 6 7 · «PREV |
|
jakisa
Tavern Dweller
|
posted March 18, 2024 10:24 PM |
|
|
Is it possible to give a hero elves equal to his level whenever he defeats an army in scripts?
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 18, 2024 11:27 PM |
|
|
jakisa said: Is it possible to give a hero elves equal to his level whenever he defeats an army in scripts?
More information is needed here. Is this only for a single hero that is already placed on the map? Or are you thinking of applying this to any hero, including hired heroes?
If the hero is placed on the map, then the answer is yes, and easily. Just add the scripting to the hero's Victorious event (the hero, not the army the hero is on). Then whenever the hero wins a battle, the Victorious event will be triggered and the scripts run.
I'll leave it to you to figure out how to give a number of elves equal to the hero's level Hint: you'll need to use triggerable events on the hero and recursion (or a lot of conditional scripts).
|
|
jakisa
Tavern Dweller
|
posted March 19, 2024 07:35 AM |
|
|
yes its for a hero who is already on the map, I am making a rpg map.i already found the victorious tab and tried to make a continous event which creates a variable that sets it to heroes level, but i cant figure out how to use this variable ( i am using the base editor btw not your advanced editor)
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 19, 2024 12:36 PM |
|
|
jakisa said: yes its for a hero who is already on the map, I am making a rpg map.i already found the victorious tab and tried to make a continous event which creates a variable that sets it to heroes level, but i cant figure out how to use this variable ( i am using the base editor btw not your advanced editor)
A continuous event isn't what you want since it will be called for every action during the game. Just set the variable to the hero's level in the Victorious event.
As to how you use that variable, that's what my hint was referring to
In a triggerable event, give one elf to the hero, then subtract one from your variable. If the variable is greater than 0, call the triggerable event again. Call this triggerable event from the victorious event after setting the variable.
|
|
jakisa
Tavern Dweller
|
posted March 19, 2024 08:31 PM |
|
Edited by jakisa at 20:48, 19 Mar 2024.
|
wow thank you, you are a genius
I decided to make a roguelike map like slay the spire where you choose a path between things like events, treasures, normal enemy, elite enemy etc.
I plan to change some creature stats with the resource editor and also the creature level so that e.g. all level 3 enemies are elite, level 4 are boss enemy and so on. That way I can use random enemies for more different playthroughs. My question is what determines how stong a peasant is? Experience, or all stats combined. And does it change when I change the peasants stats?
Also are there any scriptable options for loading or saving the game?
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted March 19, 2024 09:26 PM |
|
|
jakisa said: wow thank you, you are a genius
No problem, I've just done quite a bit of advanced scripting
jakisa said: I decided to make a roguelike map like slay the spire where you choose a path between things like events, treasures, normal enemy, elite enemy etc.
I plan to change some creature stats with the resource editor and also the creature level so that e.g. all level 3 enemies are elite, level 4 are boss enemy and so on. That way I can use random enemies for more different playthroughs. My question is what determines how stong a peasant is? Experience, or all stats combined. And does it change when I change the peasants stats?
You're talking about the PEON value on random monster objects? I would guess it's based on the experience amount of creatures, but I'm not at all sure as it's not something I've ever explored before.
If someone else that knows doesn't chime in, you can always view the various experience values for creatures from the creatures table and see if they align with the number of potential creatures on random monster objects when you change the PEON value.
jakisa said: Also are there any scriptable options for loading or saving the game?
Not sure what you are asking here. Can you elaborate?
|
|
iliveinabox05
Honorable
Famous Hero
|
posted June 06, 2024 07:53 PM |
|
|
relancer said: Well I already got a weirdness (low possibility that affects your code as well)
Hey relancer, if you're still around, I just saw someone using my Java libraries for resources through Python.
So, you could actually just use my jar files from the advanced editor and access my .h4c API directly from my libraries!
You would be able to then do everything you wanted to do, and super easy. No bugs or searching for strings that could show up somewhere else.
Looks like it's called jpype
|
|
|
|