|
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
|
|
relancer
Hired Hero
|
posted July 23, 2024 10:11 AM |
|
Edited by relancer at 10:17, 23 Jul 2024.
|
I actually have no idea what I want more, except one thing you do (or did not) not have and this is a translator (EventWriter).
My plan was to get generator / maybe true about battle simulator&generator mix. Now I have this generator, also I improved it for code edition purpose and made it more config friendly, so it have 3 scenarios (selected by modyfiying one config value): PVE, PVP, normal map full patch. I might add more scenarios, like same race army or other, but that's scenario-idea related and not a problem in all.
I want to do a script translator, but honestly, there is a colision. When we talk about generator and playing generated maps, I'm actively using it. About script translator, it would be fine, still I dont sure I will use it frequently, also, because of high workload and lights off, it's more problematic than previous.
This topic you say about using jar for python might be interesting for educational purpose, because usually I do not mix languages (and actually I dont know java well, except I can normally read it). I might try (dont sure when).
But if I decide to use event parse API and add EventWriter I might need for purpose I wrote, I still prefer to overwrite a bit in a matter of huge code size reduction. But idk if I get enough time and will for that in soon future.
Actually java api might be useful for other objects like cities or like that, or full map parse, but to work with parsed object I will need Java only, and that's also a problem.
So it can be a problem with "what I want" and "whence to get normal amout of time for that" )
This site was down for a while.
What may be useful, if you show or write in readme/desc/here examples how did they actually use it and what the results.
|
|
iliveinabox05
Honorable
Famous Hero
|
posted July 23, 2024 10:22 PM |
|
|
Just letting you know you can easily do everything you want in python using my jar files You can parse h4c files, access and modify their data, and then save the new file, all using my libraries.
Here is an example of what someone did in python to access h4 resources:
import jpype
import jpype.imports
jpype.startJVM(classpath = ["lib/*"])
from java.io import File
from java.nio import ByteBuffer, ByteOrder
from Interfaces import H4TableParser
from Utility import Util
f = File("table.creature_abilities.h4d")
buffer = ByteBuffer.wrap(Util.getBytesFromFile(f))
buffer.order(ByteOrder.LITTLE_ENDIAN)
table = H4TableParser(buffer, "table.creature_abilities.h4d")
print(table.getCsvString())
**********************
This uses File and ByteBuffer from Java libraries, and H4TableParser and Util from my libraries.
You could use H4CampaignParser and H4MapParser for starters. There are event and script classes as well, though they won't have all of my more recent updates.
|
|
bbhero
Tavern Dweller
|
posted August 24, 2024 12:08 PM |
|
Edited by bbhero at 12:09, 24 Aug 2024.
|
Cannot edit/ create conditions in events
Hi, great job with this editor, the copying events feature has been a gamechanger for me.
One issue though (especially since moving to a new Win11 laptop) is that , I cannot edit/ create conditions in events, I can edit what the event does, but now when it triggers (see img below)
https://postimg.cc/Q9d7j0CS
putting links to images as well, as they do not display correctly
The issue is that, on this laptop, I cannot create events also in the Official Editor (see below):
https://postimg.cc/r0wf7Gk2
Has anyone ever encountered such a situation? And more importantly, does anyone have a solution to it?
Many thanks!
|
|
iliveinabox05
Honorable
Famous Hero
|
posted August 24, 2024 04:52 PM |
|
|
bbhero said: Hi, great job with this editor, the copying events feature has been a gamechanger for me.
One issue though (especially since moving to a new Win11 laptop) is that , I cannot edit/ create conditions in events, I can edit what the event does, but now when it triggers (see img below)
Hey there! Great to see you're getting some good use out of the advanced editor!
So the issue with not being able to edit the condition is because.. I never came up with a good way to display it
Probably the best way is to do another script tree with condition restrictions. Since you're actually wanting to use this feature, that gives me the motivation to finally add it
bbhero said: The issue is that, on this laptop, I cannot create events also in the Official Editor (see below):
Has anyone ever encountered such a situation? And more importantly, does anyone have a solution to it?
Many thanks!
Huh that's a weird one. I feel like someone else has posted something similar, but I don't remember if they figured out a solution.
Maybe install again (to a new folder) and see if the issue persists?
Edit. You can also post the map so someone could see if the issue happens in their editor as well. You can pm it to me if you want.
|
|
bbhero
Tavern Dweller
|
posted August 25, 2024 01:11 AM |
|
Edited by bbhero at 04:02, 25 Aug 2024.
|
Thanks. I think adding it to the tool would be very useful!
Re: my issue with the official editor, it happens with every map I open/ create, so that's not a map-specific problem unfortunately.
I cannot see a way to reinstall only the editor, so reinstalling the whole game may be the only option :/
EDIT: Still not working :/ I just don't know what's the issue/ how to solve it. Everything else in the editor works just fine, it's just that the buttons to add/ edit scripts are missing :|
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted August 25, 2024 01:49 AM |
|
|
bbhero said: Thanks. I think adding it to the tool would be very useful!
Re: my issue with the official editor, it happens with every map I open/ create, so that's not a map-specific problem unfortunately.
I cannot see a way to reinstall only the editor, so reinstalling the whole game may be the only option :/
Yeah I just meant reinstalling the game, but to a new folder so you don't do anything to your other installation. Then if the issue happens again, you can just delete the new installation and try something else.
|
|
iliveinabox05
Honorable
Famous Hero
|
posted August 25, 2024 07:48 PM |
|
|
bbhero said: EDIT: Still not working :/ I just don't know what's the issue/ how to solve it. Everything else in the editor works just fine, it's just that the buttons to add/ edit scripts are missing :|
Hmm, what happens if you change your screen resolution? Seems like the part of the panel with the buttons is just not sized correctly and they're hidden.
|
|
bbhero
Tavern Dweller
|
posted August 25, 2024 10:49 PM |
|
Edited by bbhero at 23:43, 25 Aug 2024.
|
iliveinabox05 said:
bbhero said: EDIT: Still not working :/ I just don't know what's the issue/ how to solve it. Everything else in the editor works just fine, it's just that the buttons to add/ edit scripts are missing :|
Hmm, what happens if you change your screen resolution? Seems like the part of the panel with the buttons is just not sized correctly and they're hidden.
No luck as well. I tried different resolutions and also compatibility modes, but it's yet something else.
The thing is, there is space for the New / Edit / Remove panel, but it's just missing. Well, it seems that for H4 editor, I'll need to get back my old W10 laptop, but that's just super weird, given that everything else works perfectly...
https://postimg.cc/D46v5bHP
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted September 05, 2024 09:02 PM |
|
|
bbhero said: No luck as well. I tried different resolutions and also compatibility modes, but it's yet something else.
The thing is, there is space for the New / Edit / Remove panel, but it's just missing. Well, it seems that for H4 editor, I'll need to get back my old W10 laptop, but that's just super weird, given that everything else works perfectly...
I'm currently working on showing conditional requirements and making them editable. Just trying to track down an exception, and then the display part should be good to go.
|
|
relancer
Hired Hero
|
posted October 13, 2024 10:33 PM |
|
Edited by relancer at 22:42, 13 Oct 2024.
|
Hi
Hi Derrick
Actually I mostly did not do anything except better usability
I want you to try a generator and play the generated maps with a feedback.
Preferably - on the vanilla HOMM4, but does not matter much.
Current requirements: just have a Python. No package install required (only standard library is used) and code is open (for those who may afraid hacks)
Things to do:
1) clone the repo
2) edit `user_config.json` - map_final_location to be a your Maps folder in the game - count slashes (follow example) - it will put map automatically to this folder. Map name is `syka_updated.h4c` actually placed in that config if you decide to change. Map name in the game - `syka`
3) edit a scenario number in config.
4) run python script_workaround.py
5) just play
Scenario number meanings - generally described in the `h4_scenario.py`
There are 7+ fightplaces , but you can try one or two to see the pros and cons.
Short about scenario numbers:
1) PVE - you have to fight blue enemy, then you need to fight neutral. You can activate all the buffs before all the battles. NOT recommended to remove gear (even if it's negative) or use beaten blue gear. You receive potions before battle, your enemy does not. Count of immortality potions is always 1.
2) PVP - neutral amy is a few monks. Both of you have potions, may change the unit orders and just fight with a real man
3) map patch. For this you need to copy the map to this folder, change the user_config (map_path, output_map_path, usual_map_ai_multiplier, normal_map_human_player_id) in a json file.
It paches any map with a replacing heroes and neutrals army by currenly used replacer. It does not replace heroes with scripts and break quests, if they are required named hero. It's better to try on the map without scripts. You will get MORE interesting map. usual_map_ai_multiplier = 10 currently indicates, that all the enemy heroes will receive 10 times more army, that usual generating does for player and neutrals. normal_map_human_player_id should reflect your color that will receive standardly generated random army without extra modifiers
4) 1 army slot and 6 heroes on each side. Unit is a really buffed! + neutral army without hero. No potions
5) all slots are heroes. Neutral are also heroes too. You may cast only immortality spell if you have one, and just fight after) You will get the meaning of resistance, ring of big ignoration and others)
I usually play 1 and 5 scenarios, and 2 if have real opponent.
Please try and tell how it feels for you.
One moment about config.use_unique_scrolls. If applied, heroes will receive scrolls with only unique spells. This will crash editor, but fine for game. If it's disabled (0), you scrolls will only have usual spells and homm4 vanilla editor is fine with it
|
|
|
|