[H5 EDITOR] Troubleshooting topic
How do you make an objective (trigger) to show up on day #1. I understand how to setup an objective but if they are set to be active already then they don't show the new objective box or the target glance location on day one.
- I tried having the active state being turned on when using a DAY trigger but it never works on day #1.
- The only way I have found is to create a region trigger that then activates the objective.
Does anyone know how I can activate the trigger on day one?
- I tried having the active state being turned on when using a DAY trigger but it never works on day #1.
- The only way I have found is to create a region trigger that then activates the objective.
Does anyone know how I can activate the trigger on day one?
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
Here is another example from my Shadow Dreams map.Cyanight wrote:How do you make an objective (trigger) to show up on day #1. I understand how to setup an objective but if they are set to be active already then they don't show the new objective box or the target glance location on day one.
- I tried having the active state being turned on when using a DAY trigger but it never works on day #1.
- The only way I have found is to create a region trigger that then activates the objective.
Does anyone know how I can activate the trigger on day one?
Set up the objectives you want to appear on day one outside of and before the beginning of the new day trigger. Here for example is how I set my the objectives I wanted to be active on Day 1 in Shadow Dreams.
To make an objective visible use SetObjectiveVisible.
------------------------------------------------
--Initial Objectives----------------------------
------------------------------------------------
SetObjectiveState ("Instant Travel Dream", OBJECTIVE_ACTIVE,whoishuman);
SetObjectiveVisible ("Instant Travel Dream", false, whoishuman);
SetObjectiveState ("Defeat the Red Slayer", OBJECTIVE_ACTIVE,whoishuman);
SetObjectiveVisible ("Defeat the Red Slayer", true, whoishuman);
if whoishuman == 1 then
SetObjectiveState ("Find Tower Grump", OBJECTIVE_ACTIVE,PLAYER_1);
SetObjectiveVisible ("Find Tower Grump", true, PLAYER_1);
SetObjectiveState ("Rescue Cyrus", OBJECTIVE_ACTIVE,PLAYER_1);
SetObjectiveVisible ("Rescue Cyrus", true, PLAYER_1);
end;
if whoishuman == 2 then
SetObjectiveState ("FaeryRingTrouble", OBJECTIVE_ACTIVE,PLAYER_2);
SetObjectiveVisible ("FaeryRingTrouble", true, PLAYER_2);
SetObjectiveState ("Rescue Alaron", OBJECTIVE_ACTIVE,PLAYER_2);
SetObjectiveVisible ("Rescue Alaron", true, PLAYER_2);
end;
if whoishuman == 4 then
SetObjectiveState ("Thieves Guild Trouble", OBJECTIVE_ACTIVE,PLAYER_4);
SetObjectiveVisible ("Thieves Guild Trouble", true, PLAYER_4);
end;
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."
Day One Triggering
I wish to add to what GOW has said: Any script code that you place outside of a function will be run on day one. In addition to activating objectives, you could for example, declare global variables, deactivate certain objects, display message boxes, etc. all of which will happen on day one prior to any actions the player can take.
Re: Day One Triggering
Thanks.. I never thought of that. I guess its my strict programming nature that I dont try things outside the box, hehe.
Last night I spent some more time designing and I cam across another problem. I cannot get the "points of light" to work on an object.. I tried to use the exact example in the "Mapmaking Theory" pdf but it would not show up. I was using the point of lights on a "Sage's hut" that was on the surface not undergoround. Anyone have an idea what Im doing wrong or why I could not see the light?
Last night I spent some more time designing and I cam across another problem. I cannot get the "points of light" to work on an object.. I tried to use the exact example in the "Mapmaking Theory" pdf but it would not show up. I was using the point of lights on a "Sage's hut" that was on the surface not undergoround. Anyone have an idea what Im doing wrong or why I could not see the light?
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
You will not see the new point of light in the editor unless you switch to the underground and then back to topside. If that doesn't work for you let me know and I'll go through the process step by step.
GOW
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."
Not sure exactly what you mean.. I did try to view the light while playing the scenario not in the editor and still I cannot get the light to show up.Grumpy Old Wizard wrote:You will not see the new point of light in the editor unless you switch to the underground and then back to topside. If that doesn't work for you let me know and I'll go through the process step by step.
GOW
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
1) Click on the object you want to attatch a light source to in order to highlight the object.
2) Click on the Object Properties Tree button.
3) Right click on "pointlights."
4) Chose Add
5) Click on the plus sign next to "pointlights."
6) Click on the plus sign next to "[0]."
7) Click on the plus sign next to "Pos."
8) Across from "z" under the "Value" heading click and type 5 (that is the numbe I use, you can experiment with different values.)
9) Click on the plus sign in front of "Color." You can now either enter values in each of the x, y, and z fields to make a color or you can click across from "color" to select a color directly.
If you click across from color you also need to click on the "...." button and then you can select a color.
10) Now you need to click across from "Radius" and enter the radius you want the light to extend around the object. Lets's say 20. You'll have to experiment to see exactly what radius you want for the light in your map for that object.
Now you can close the object properties tree window. The object is still highlighted so click on an empty space in your map to unhighlight it.
It looks like for the TOTE editor they have made the light source instantly work, but if you don't see a change then click on view-->show underground-->view-->show terrain and you'll see the light now attatched to your hut.
2) Click on the Object Properties Tree button.
3) Right click on "pointlights."
4) Chose Add
5) Click on the plus sign next to "pointlights."
6) Click on the plus sign next to "[0]."
7) Click on the plus sign next to "Pos."
8) Across from "z" under the "Value" heading click and type 5 (that is the numbe I use, you can experiment with different values.)
9) Click on the plus sign in front of "Color." You can now either enter values in each of the x, y, and z fields to make a color or you can click across from "color" to select a color directly.
If you click across from color you also need to click on the "...." button and then you can select a color.
10) Now you need to click across from "Radius" and enter the radius you want the light to extend around the object. Lets's say 20. You'll have to experiment to see exactly what radius you want for the light in your map for that object.
Now you can close the object properties tree window. The object is still highlighted so click on an empty space in your map to unhighlight it.
It looks like for the TOTE editor they have made the light source instantly work, but if you don't see a change then click on view-->show underground-->view-->show terrain and you'll see the light now attatched to your hut.
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."
Use the startThread command only to start a thread. Use a trigger to start ordinary functions, but not threads.ransomdl wrote:rdeford,
The Scripting Guide references "startThread" comand to initiate a function as an alternative for a "Trigger" function. Can you write a Script function command anywhere in the Script and trigger the function with a "startThread" command?
EDIT: Oh, and you can write a function anywhere in the script and trigger it from anywhere in the script. Same thing for threads. In other words, the function and the trigger do not have to be sequential in order within the script. In fact, a trigger can even be placed inside a different function than the one it triggers.
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
rdeford,
Thank you for the reply. Sometimes I struggle when adding a script to an existing script that already has a Trigger(NEW_DAY_TRIGGER) and I can't figure how to trigger a new function that works the same day every week when the Trigger(NEW_DAY_TRIGGER) has already been used for a different function.
Your knowledge and wisdom is always helpful.
Thank you for the reply. Sometimes I struggle when adding a script to an existing script that already has a Trigger(NEW_DAY_TRIGGER) and I can't figure how to trigger a new function that works the same day every week when the Trigger(NEW_DAY_TRIGGER) has already been used for a different function.
Your knowledge and wisdom is always helpful.
ransomdl
Warlock
Warlock
@ ransomdl-- I am looking forward to playing your first map.ransomdl wrote:rdeford,
Thank you for the reply. Sometimes I struggle when adding a script to an existing script that already has a Trigger(NEW_DAY_TRIGGER) and I can't figure how to trigger a new function that works the same day every week when the Trigger(NEW_DAY_TRIGGER) has already been used for a different function.
Your knowledge and wisdom is always helpful.
Here is how to handle multiple function calls with the same trigger, for example the NEW_DAY_TRIGGER. This example comes from the script of my Mining Tycoon map:
Code: Select all
--=========================
-- dawn heartbeat of the mining company
--=========================
function dawn()
replinishTraders(); -- replenish trader resource amounts
shutDownMinesNW(); -- shutdown mines with no workers
shutDownFeedersND(); -- shutdown feeders when no days of service remain
attackFeedersNI(); -- attack a feeder if no insurance policy is in force
shutDownMinesNF(); -- shutdowm mines when there arn't enough active feeders
generateWorkers(); -- generate workers in Union Hall based on active feeders
setInsuranceAmt(); -- ratchet premiums upwards
checkInsurance(); -- inform player when policy expires
sabotageMinesAI(); -- AI players sabotage mines periodically to make things fun
attackMinesAI(); -- AI players send claim jumpers periodically to make things fun
lowerMoral(); -- worker moral deteriorates daily
holdFestival(); -- raise worker moral if festival has been purchased
workerTurnover(); -- workers quit because of low moral
bankIntrestCk(); -- see if player earns any intrest
getP1BestHeroLevel(); -- save player's best hero level
upgradeAIheroes(); -- level up the best AI hero for each AI player to approach P1 best hero level
end;
Trigger(NEW_DAY_TRIGGER, "dawn");
Code: Select all
function setInsuranceAmt()
if mod(GetDate(DAY), 12) == 0 then
unionBribeAmt = unionBribeAmt + 50
MessageBox(path.."insuranceRatesUp.txt")
end;
end;
Here is another of the dawn functions:
Code: Select all
-- shutdown mines with no workers
function shutDownMinesNW()
for i=1, 20 do
if GetObjectOwner("mine"..i) == PLAYER_1 then
mineStatus[i] = 0;
mineStatus[i] = mineStatus[i] + GetObjectCreatures("mine"..i, CREATURE_EARTH_ELEMENTAL);
mineStatus[i] = mineStatus[i] + GetObjectCreatures("mine"..i, CREATURE_AIR_ELEMENTAL);
mineStatus[i] = mineStatus[i] + GetObjectCreatures("mine"..i, CREATURE_FIRE_ELEMENTAL);
mineStatus[i] = mineStatus[i] + GetObjectCreatures("mine"..i, CREATURE_WATER_ELEMENTAL);
if mineStatus[i] == 0 then -- no workers in mine
SetObjectOwner("mine"..i, 0);
MessageBox( { path.."mineShutdown.txt"; mNum = i } );
end;
end;
end;
end;
And so on. As you can see, you can make single function such as "dawn" into a large, multi-purpose workhorse that do all the daily housekeeping chores for your map when and where they are needed. There is no limit to the number of sub-functions that you can place inside a function.
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
rdeford,
Thanks for the information. Far more than I expected, but greatly appreciated as I have already applied the use of some of your comments to trigger functions anywhere on the map and not necessarily with the function. I am still working on when to utilize "startThread" for certain functions. Someday, I will put this all together and hopefully get you a map to test.
Thanks for the information. Far more than I expected, but greatly appreciated as I have already applied the use of some of your comments to trigger functions anywhere on the map and not necessarily with the function. I am still working on when to utilize "startThread" for certain functions. Someday, I will put this all together and hopefully get you a map to test.
ransomdl
Warlock
Warlock
Set up a function similar to the dawn() function described above. For example:Metathron wrote:I would like a castle to give me 2 death knights each 7 days.
How do I go about doing this?
Code: Select all
function dawn()
replinishCastle(); -- add Death Knights to castle
end;
Trigger(NEW_DAY_TRIGGER, "dawn");
Code: Select all
function replinishCastle()
if mod(GetDate(DAY), 7) == 0 then
AddObjectCreatures(objectName, creatureID, quantity);
end;
end;
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
IMO, the H5 Editor is a tool created by the H5 development team for use by the programmers to create the maps that shipped with the game. I think that Ubisoft didn't include the development of a map editor in their contract with the developers. Then, as an after thought, due to fan pressure, they realized they had to have a map editor and took what was available. Consequently, given its intended users (i.e., programmers) the H5 Editor is not user-hostel.Metathron wrote: I knew the HoMM V editor was user-hostile, but I didn't know you had to be a rocket scientist to use it.
Yes, in order to write scripts, you do have to learn how to write and use a programing language, albeit at a far lower level than a professional programmer would. Given that a non-professional skill level is all that is required, it really isn't that hard. I am merely a retired technical writer, and I managed to learn how to write H5 scripting with just a vague familiarity with Apple BASIC that I gained about 30 years ago.
Tell you what Metathron, I love HOMM, and it saddens me that so many of the fan map makers that made H3 and H4 live on in our hearts have abandoned H5 because of the difficulty in learning how to write scripts for it.
So, I hereby make this commitment to you: I will author an H5 Scripting Tutorial that will take you step-by-step through the process of writing an H5 script. I will explain the how and why of each step and explain the underlying programming concepts in plain language. By the end of this tutorial, you will have the knowledge and the skill required to create your own custom, scripted H5 maps. All I ask from you is for you to "beta test" the tutorial by going through it and doing all the exercises and make comments, suggestions, and criticisms prior to me releasing it to the HOMM community.
How about it Metathron, and/or any other interested map makers, any volunteers?
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
Undergournd Bridges
So I have been trying to use the underground bridges and connecting them to the underground ground, but when i use it it shows up in the air, nowhere near where any player could walk on it. Does anyone know what im talking about
that is if anyone still looks at this post anymore
that is if anyone still looks at this post anymore
- Grumpy Old Wizard
- Round Table Knight
- Posts: 2205
- Joined: 06 Jan 2006
- Location: Tower Grump
Make "humps" by bulk raising the ground at the bridge ends. It takes a bit of trial and error.
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."
Undergournd Bridges
Well, somehow I dont think it is that simple
Because the ground level that you lower the grid to to make any kind of buildings is where the bridges are, they are high enough to be over anything in the dungeon and not touch it
Because the ground level that you lower the grid to to make any kind of buildings is where the bridges are, they are high enough to be over anything in the dungeon and not touch it
Undergournd Bridges
unless im using an outdated editor or something, but it has all the TOE creatures and stuff in it, so im kind of assuming its probably correct.
Who is online
Users browsing this forum: No registered users and 1 guest