[H5 EDITOR] Troubleshooting topic
Hope to get heard...
anyway... There's my next trouble. I mean not a trouble as script works, but if it could be more simple I'm in to an other kind of solution!!
- Quest is to eleminate two players from the game (singleplayer) but there was now eleminatefunction, nor eleminate triggering so I wrote the following script:
Trigger(OBJECT_CAPTURE_TRIGGER,"Inferno","HellDesert")
Trigger(OBJECT_CAPTURE_TRIGGER,"Necro","HellDesert")
Trigger(PLAYER_REMOVE_HERO_TRIGGER,2,"HellDesert")
Trigger(PLAYER_REMOVE_HERO_TRIGGER,3,"HellDesert")
function HellDesert()
if IsHeroAlive("Aberrar") == nil then
if IsHeroAlive("Oddrema") == nil then
if GetObjectOwner("Inferno") == 1 then
if GetObjectOwner("Necro") == 1 then
SetObjectiveState("Enemies",OBJECTIVE_COMPLETED)
RemoveObject("CGolem")
end;
end;
end;
end;
end;
OR didn't work when Triggering:
Trigger(OBJECT_CAPTURE_TRIGGER,"Inferno" OR "Necro","HellDesert")
AND didn't work in IF condition:
if IsHeroAlive("Oddrema") == nil AND IsHeroAlive("Aberrar") then...
anyway... There's my next trouble. I mean not a trouble as script works, but if it could be more simple I'm in to an other kind of solution!!
- Quest is to eleminate two players from the game (singleplayer) but there was now eleminatefunction, nor eleminate triggering so I wrote the following script:
Trigger(OBJECT_CAPTURE_TRIGGER,"Inferno","HellDesert")
Trigger(OBJECT_CAPTURE_TRIGGER,"Necro","HellDesert")
Trigger(PLAYER_REMOVE_HERO_TRIGGER,2,"HellDesert")
Trigger(PLAYER_REMOVE_HERO_TRIGGER,3,"HellDesert")
function HellDesert()
if IsHeroAlive("Aberrar") == nil then
if IsHeroAlive("Oddrema") == nil then
if GetObjectOwner("Inferno") == 1 then
if GetObjectOwner("Necro") == 1 then
SetObjectiveState("Enemies",OBJECTIVE_COMPLETED)
RemoveObject("CGolem")
end;
end;
end;
end;
end;
OR didn't work when Triggering:
Trigger(OBJECT_CAPTURE_TRIGGER,"Inferno" OR "Necro","HellDesert")
AND didn't work in IF condition:
if IsHeroAlive("Oddrema") == nil AND IsHeroAlive("Aberrar") then...
And remember "To all things comes an end but in every end there's a new beginning."
MUG == Miss U Gorgons
MUG == Miss U Gorgons
OK I'm not sure to understand what you're trying to do but while I was working on LotA I discovered a function which, I think, is not documented in the editor's manual.
It is
It returns a number. Can't remember exactly what the numbers mean, except the 3 which is returned when PLAYER is defeated.
So you could have a trigger like
(--yes you can't use OR operators in Triggers, you must set the trigger for every town individually)
and another for when the enemy loses a hero (any hero) :
And as I'm not a programmer I prefer setting different functions for things, easier for me :
Just my two cents, hope it'll help you.
It is
Code: Select all
GetPlayerState(PLAYER);
So you could have a trigger like
Code: Select all
Trigger (OBJECT_CAPTURE_TRIGGER, "Inferno", "HellDesert");
and another for when the enemy loses a hero (any hero) :
Code: Select all
Trigger( PLAYER_REMOVE_HERO_TRIGGER , PLAYER_2, "check_enemy" );
Code: Select all
function Helldesert(prevowner, newowner)
if newowner==PLAYER_1 then
check_enemy();
end;
end;
function check_enemy()
if GetPlayerState(PLAYER_2)==3 then
SetObjectiveState("Enemies",OBJECTIVE_COMPLETED)
RemoveObject("CGolem")
...
end;
end;
Need help with combat scripts
Can't make the function SetHeroCombatScript work!
I have the script, I have the xdb-file, they both Unicode. When I make call like SetHeroCombatScript(hero,path.."mycombat.xdb") the game responds that the file does not exist.
How does one set a combat script?!
I have the script, I have the xdb-file, they both Unicode. When I make call like SetHeroCombatScript(hero,path.."mycombat.xdb") the game responds that the file does not exist.
How does one set a combat script?!
Razing Objects
I am having trouble with the raze object command. I ran the script and the object disappeared before I triggered it and no "razed" object appeared. When I went back into the map editor, the object was gone but remained on the object list. I am trying to change a Mystical Garden into the 2x2 size snag so they are the same size. I also masked the active tile on the Mystical Garden. What am I missing?
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
Re: Razing Objects
I haven't played around with the raze object command, but I think you have to specify the model that replaces the razed object. I also didn't know that raze could be used for anything but a town.mweil86 wrote:I am having trouble with the raze object command. I ran the script and the object disappeared before I triggered it and no "razed" object appeared. When I went back into the map editor, the object was gone but remained on the object list. I am trying to change a Mystical Garden into the 2x2 size snag so they are the same size. I also masked the active tile on the Mystical Garden. What am I missing?
GOW
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
I have been playing around with trying to get SetObjectPosition to work for something other than a hero. I can move a heroe just fine with SetObjectPosition, but can't get anything else to move.
I also have tried to get RemoveObject to work with no success. Here is an example of a function I wanted to trigger when the player enters a region. The dwarven stones named "Test Block" did not go away, but the message did display so I know the function was triggered. What did I do wrong?
I also have tried to get RemoveObject to work with no success. Here is an example of a function I wanted to trigger when the player enters a region. The dwarven stones named "Test Block" did not go away, but the message did display so I know the function was triggered. What did I do wrong?
GOWfunction NewExile(heroename)
MessageBox(path.."Newly Exiled.txt");
RemoveObject ("Test Block");
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "rgnNewlyExiled", nil);
end;
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "rgnNewlyExiled", "NewExile");
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
The patches may have messed it up but in early game versions it had to be done:Grumpy Old Wizard wrote: I also have tried to get RemoveObject to work with no success. Here is an example of a function I wanted to trigger when the player enters a region. The dwarven stones named "Test Block" did not go away, but the message did display so I know the function was triggered. What did I do wrong?
1. place named blocks somewhere on map, where their absence/presence goes unnoticed
2. Block the area where the blocks should be
3. Day 1 SetObjectPosition and move the objects to blocked region
4. Script that opens passage will SetObjectPosition to another location againand the area under them is turned passable.
Avatar image credit: N Lüdimois
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
Thanks Pitsu, that did the trick.
I noticed that not all items have the IsRemovable field (which I changed to true) in the object properties, so I'm guessing that those items that don't can't be moved. The blocks worked, but when I tried a monolith (which does not have the field) it wouldn't move.
GOW
I noticed that not all items have the IsRemovable field (which I changed to true) in the object properties, so I'm guessing that those items that don't can't be moved. The blocks worked, but when I tried a monolith (which does not have the field) it wouldn't move.
GOW
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
Passing values to wands and scrolls?
If you hover your cursor over a wand or scroll in the map editor you see
Has anyone found a way to work with any of these variables or to specify the spell that is on the wand/scroll (aside from placing it on the map and hitting the spacebar.)
I would like to be able to give specific wands or scrolls for a quest reward, but can't figure out how to do it.
GOW
The wand also has 2 more variables associated with it for charges (current and maximum.)Allows casting of magic spell < value=spell_name > from this wand(or scroll)
Has anyone found a way to work with any of these variables or to specify the spell that is on the wand/scroll (aside from placing it on the map and hitting the spacebar.)
I would like to be able to give specific wands or scrolls for a quest reward, but can't figure out how to do it.
GOW
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Re: Passing values to wands and scrolls?
Anybody has a slightest idea how to organize a function that will trigger every time a battle starts and/or ends? As far as I know, there is now such trigger.
I believe it can be arranged with touch object trigger, but that will require a lot of efforts, like assigning the trigger to EVERY creature stack and hero! That's cumbersome...
I believe it can be arranged with touch object trigger, but that will require a lot of efforts, like assigning the trigger to EVERY creature stack and hero! That's cumbersome...
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
To my knowledge combat scripts can only be placed on AI heroes and creature stacks.
If anyone knows how to place them on a player controlled heroe please enlighten us because I would like to do some things with combat scripts on a player hereo.
GOW
If anyone knows how to place them on a player controlled heroe please enlighten us because I would like to do some things with combat scripts on a player hereo.
GOW
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."
Re: Passing values to wands and scrolls?
It is annoying to name all neutrals and other battle sites. Assigning triggers can be done easily (for objects named as monster1, monster2 ...monster60):Franzy wrote: I believe it can be arranged with touch object trigger, but that will require a lot of efforts, like assigning the trigger to EVERY creature stack and hero! That's cumbersome...
Code: Select all
for i= 1, 60 do
Trigger(OBJECT_TOUCH_TRIGGER, "monster"..i, "combat");
end;
And no suggestion about how to assign a combat script to players hero at the moment.
Avatar image credit: N Lüdimois
Combat scripts work ok with ANY heroes. Use SetHeroCombatScript function. Problem is if two hero engage in a battle only attacker hero's script will work.Grumpy Old Wizard wrote:To my knowledge combat scripts can only be placed on AI heroes and creature stacks.
If anyone knows how to place them on a player controlled heroe please enlighten us because I would like to do some things with combat scripts on a player hereo.
GOW
What exactly do you want to do? If you want a function to execute after each combat you could use the following technique : Use the SetGameVar function since you can modify the values of variables in combat. You could have a thread that act when a certain variable have a value of 1 (after a combat) and then execute what it has to do and then change it back to 0.Franzy wrote:Anybody has a slightest idea how to organize a function that will trigger every time a battle starts and/or ends? As far as I know, there is now such trigger.
I believe it can be arranged with touch object trigger, but that will require a lot of efforts, like assigning the trigger to EVERY creature stack and hero! That's cumbersome...
What pitsu said does work if you want to exectute a function every time a battle is about to start.
If you could just give more details we might be able to help you.
Use a separate program in another window. Flip between windows while you work.alavris wrote:Does anybody know if it is possible to open official (Ubisoft-made) maps in the editor? If yes, then how do you do this?
OOPS-- Wrong answer. Sorry. I misread your question to be how to open the Ubisoft game manuals while using the editor.
Right answer: You can open the campaign maps in the editor but you have to unbundle them first. Neckie over on Elrath unbundled all the maps for the HOF campaigns and posted them for editing or playing them one at a time. But, I cannot seem to find Elrath.com right now so I cannot give you the link. I downloaded the maps onto my computer when I had access to Elrath, and I do open them regularly. But, I don't know know off the top of my head how to unbundle them myself.
Last edited by rdeford on 22 Oct 2007, 22:34, edited 1 time in total.
rdeford, Mage Of Soquim
“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."
Ernest Holmes 1984
“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."
Ernest Holmes 1984
- Metathron
- Round Table Hero
- Posts: 2704
- Joined: 29 Jan 2006
- Location: Somewhere deep in the Caribbean...
- Contact:
Alright, so I am trying to modify an existing HoMM V map. What I want to do is simple - increase the number of creatures guarding the choke points that lead into each of the 6 players' lands. I have done this without difficulties, but when I try to play the dwarves or barbarians the old HoF problem occurs; namely, you can't choose any dwarven or barbarian heroes from the starting menu, which is really annoying.
Can this be fixed easily?
Can this be fixed easily?
Jesus saves, Allah forgives, Cthulhu thinks you'd make a nice sandwich.
======response======Metathron wrote: problem occurs; namely, you can't choose any dwarven or barbarian heroes from the starting menu, which is really annoying.
Can this be fixed easily?
I just did a quick test map to check this out. It looks like all you have to do is to open the map in the HOF editor. Click on the View/Map Properties. Click on the Player Properties. Use the dropdown list to select the player that controls the castle you wish to use (e.g., Inferno or Dwarf). Click the Main Town check box to put a check mark there (a Inferno or Dwarf town will be automatically shown). And now, here is the magic step that will resolve the problem-- click the Generate Hero In Town check box to put a check mark there. Repeat for each town you desire to select heroes in.
If this doesn't work let me know the name of the map and I'll figure something out for you on the map itself.
rdeford, Mage Of Soquim
“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."
Ernest Holmes 1984
“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."
Ernest Holmes 1984
Who is online
Users browsing this forum: No registered users and 0 guests