[H5 EDITOR] Troubleshooting topic

Maps and the art of mapmaking.

Moderator: Moderators

meows
Peasant
Peasant
Posts: 75
Joined: 11 Oct 2006

Postby meows » Dec 5 2006, 3:54

OBJECTIVES.

Whew i did get it working but it isn't pretty at all.

Code: Select all

 function Kill_Mummy1()   
   Trigger( REGION_ENTER_AND_STOP_TRIGGER, "Kill_Mummys",nil);
    MessageBox ("/Maps/SingleMissions/Ashers World one/mummyregion.txt");
SetObjectiveState("subobj1", OBJECTIVE_ACTIVE);
end;
--end;
-----------------------------------------------------------------------------------------------------
function Kill_Wolf1()   
   Trigger( REGION_ENTER_AND_STOP_TRIGGER, "Kill_Wolves",nil);
    MessageBox ("/Maps/SingleMissions/Ashers World one/wolfregion.txt");
SetObjectiveState("subobj2", OBJECTIVE_ACTIVE);
end;
--end;
function Kill_Water1()   
   Trigger( REGION_ENTER_AND_STOP_TRIGGER, "Kill_Water",nil);
--    MessageBox ("/Maps/SingleMissions/Ashers World one/wolfregion.txt");
SetObjectiveState("subobj3", OBJECTIVE_ACTIVE);
end;
--end;


Now is there a problem with the Objective Kind Capture Object?
or with seer huts underground?

I have a hut underground with Objective Kind Capture Object and the parameters is CREATURE_SHADOW_DRAGON and the amount to get I also tried it with the creatures number. but every time i click on the seer hut in game i get no one is home with no script error.

Oh yes I did try the Objective Capture Creature and could never finish the quest.

thanks.

User avatar
Mace the Councillor
Peasant
Peasant
Posts: 57
Joined: 06 Jan 2006
Location: Sweden

Postby Mace the Councillor » Dec 5 2006, 14:44

Does anyone know how to create abyss in the Heroes V editor? I have seen it in the game, in underground levels, and it is just a black nothingness that one cannot walk over, but I have never managed to figure out how to make it myself.

Can anybody help??

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Postby Grumpy Old Wizard » Dec 5 2006, 15:34

Mace the Councillor wrote:Does anyone know how to create abyss in the Heroes V editor? I have seen it in the game, in underground levels, and it is just a black nothingness that one cannot walk over, but I have never managed to figure out how to make it myself.

Can anybody help??


You can try digging and then placing masks over the area you dig, if that is what you are after. Play around with point lights so it looks like a bottomless pit.

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."

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Postby Grumpy Old Wizard » Dec 5 2006, 15:42

meows wrote:
Now is there a problem with the Objective Kind Capture Object?
or with seer huts underground?

I have a hut underground with Objective Kind Capture Object and the parameters is CREATURE_SHADOW_DRAGON and the amount to get I also tried it with the creatures number. but every time i click on the seer hut in game i get no one is home with no script error.

Oh yes I did try the Objective Capture Creature and could never finish the quest.

thanks.


Try using defeat neutral instead. Look here for a discussion and example:
http://www.celestialheavens.com/forums/ ... ght=bounty

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."

Neckie
Peasant
Peasant
Posts: 67
Joined: 05 Oct 2006
Location: Quebec, Canada

Postby Neckie » Dec 6 2006, 3:13

I think his objective is to capture X shadow dragon so i think the Assemble Army would be better no?

meows
Peasant
Peasant
Posts: 75
Joined: 11 Oct 2006

Postby meows » Dec 7 2006, 0:46

Neckie wrote:I think his objective is to capture X shadow dragon so i think the Assemble Army would be better no?

Actually it is to kill 145 Specter Dragons.

I tried the kill netural and it almost worked but gave a success at 20ish mobs.

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Postby Grumpy Old Wizard » Dec 7 2006, 7:30

meows wrote:
Neckie wrote:I think his objective is to capture X shadow dragon so i think the Assemble Army would be better no?

Actually it is to kill 145 Specter Dragons.

I tried the kill netural and it almost worked but gave a success at 20ish mobs.


The number is the number of stacks of dragons. Are you wanting the player to kill 145 stacks of dragons or 145 total dragons?

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."

myythryyn
Assassin
Assassin
Posts: 293
Joined: 05 Sep 2006

Postby myythryyn » Dec 7 2006, 15:00

hello

im having a problem with AddHeroCreatures.

Im trying to add deathknights to a players army.
but its really strange i use this command

AddHeroCreatures ("heroname", 89, 30);

and 30 peasants are added to the players army instead....maybe a bug or glich of some sort? im sure im using command right, and 89 is supposed to be the creature ID for deathknights...

*edit*
aha i found the problem, i wanted to create a test army to kill something, so i tried to add phoenix's, which are referred to in the editor theory example for defeat neutrals as ID 90.
so i tried to add creature ID 90 and got deathknights.
i also noticed there is no creature ID 90 in the scriptID documention.
so not only is there a typo saying that deathknights are 89, but there is a typo in the editor theory as well saying that phoenix's are ID 90 :)

but i have another interesting glich/bug for you.
it has to do with Agreal.
i tried making him the final villain hero the player has to defeat, so i set up a defeat hero objective, with the name Agreal as the parameter.
and then i set up that objective to be instant victory.

but, whenever i activate the objective to defeat Agreal, what happens is that the next AI hero the player kills, no matter what name, which hero, which player's hero, the game gives me instant victory.
for some reason if you put Agreal as a parameter, it messes things up.
i guess ill have to choose another inferno hero.
im certain im using the objective right as well, since i have two other successful objectives like that on the same map for other hero names.

has anyone been able to use agreal in a defeat hero objective?

meows
Peasant
Peasant
Posts: 75
Joined: 11 Oct 2006

Postby meows » Dec 7 2006, 17:51

Just a query here.. but I have been getting Parameter lost errors with the new expansion usually with regions and after using a touch object where the object is a creature.
Any thoughts on trying to prevent this? I even keep the regions open and don't close them with the nil. But alass that didnt work either. So your awesome super programmers what can make HF reread the script to reactivate everything?

meows
Peasant
Peasant
Posts: 75
Joined: 11 Oct 2006

Postby meows » Dec 9 2006, 10:22

any one have any luck transforming any town to TOWN_FORTRESS?
I keep getting the error global not found. Same with HasHeroSkill RUNELORE.. it errors out. but I can live with that.. I need to transform a town to a Dwarven town.
I have tried regions, and the capture trigger and neither work becasue apparently the internal name for Dwarven towns is not TOWN_DWARVEN or TOWN_FORTRESS..

I even cut the script to a real simple one.

Code: Select all

function fun1(oldowner, newowner, heroname, townname)
 if GetCurrentPlayer () == PLAYER_1 then
-- if (HasHeroSkill(heroname, SKILL_RUNELORE)) then
     TransformTown("TestTown", TOWN_FORTRESS);
    Trigger(OBJECT_CAPTURE_TRIGGER, "TestTown", nil);
  end;
end;
Trigger(OBJECT_CAPTURE_TRIGGER, "TestTown", "fun1");


Now as it is now the error is TOWN_FORTESS global is NIL..
but if I rem out the line if get current player and put the HasHeroSkill line active i get the error SKILL_RUNELORE is not a good varaiable.
I also notice in the new manual that the Dwarven town is not listed.
either under functions or script id's

Neckie
Peasant
Peasant
Posts: 67
Joined: 05 Oct 2006
Location: Quebec, Canada

Postby Neckie » Dec 12 2006, 1:00

try HasHeroSkill(heroname, 151) (or HasHeroSkill(heroname, HERO_SKILL_RUNELORE)
and i must agree that the dwarven town is not listed in the script id manual

ct605
Leprechaun
Leprechaun
Posts: 6
Joined: 06 Jan 2006

Postby ct605 » Dec 12 2006, 17:47

Has anyone succeeded in attaching a script to an object through the object script box and not the game script file (e.g. place a monster, hit the space bar while the monster is highlighted and go to the script tab)? I have been experimenting to see when this script activates, but I have yet to get any results -- even when I copy a functional script directly from the game menu. I have also tried combat scripts in this box but observe no effect, so I am wondering whether the box is functional or I'm messing something up.

Neckie
Peasant
Peasant
Posts: 67
Joined: 05 Oct 2006
Location: Quebec, Canada

Postby Neckie » Dec 13 2006, 15:58

Mace the Councillor wrote:Does anyone know how to create abyss in the Heroes V editor? I have seen it in the game, in underground levels, and it is just a black nothingness that one cannot walk over, but I have never managed to figure out how to make it myself.

Can anybody help??


Those are the *Down* objects in the editor in the subterrain objects. Like walldown or innerdown or w_dno_down or W_Stalaktitdown.

Those are necessary to put down_bridge (dwarf bridge) on your maps.

meows
Peasant
Peasant
Posts: 75
Joined: 11 Oct 2006

Postby meows » Dec 15 2006, 4:02

Grumpy Old Wizard wrote:
meows wrote:
Neckie wrote:I think his objective is to capture X shadow dragon so i think the Assemble Army would be better no?

Actually it is to kill 145 Specter Dragons.

I tried the kill netural and it almost worked but gave a success at 20ish mobs.


The number is the number of stacks of dragons. Are you wanting the player to kill 145 stacks of dragons or 145 total dragons?

GOW


yes 145 dragons total. but in stacks.. tried to set multi parameters but i think i did it wrong.

User avatar
Marzhin
Pit Lord
Pit Lord
Posts: 1204
Joined: 06 Jan 2006
Location: Montreuil, France
Contact:

Postby Marzhin » Dec 19 2006, 10:59

Hi all,

I'm trying to make an secondary objective and can't make it to work.

The objective becomes active after visiting a special object on the map. It asks you to kill 4 neutral armies of vampires scattered through the map. Each time you kill one of them, it updates the Objective progress which says "You killed x vampires (out of 4)". When you have killed the 4 vampires, you may go back to the special object to end the quest and get your reward.

The problem is : I can't make the objective update and thus completing the quest is impossible.

Roughly, it works that way (I'm quoting it from memory, so the syntax may be wrong) :

Code: Select all

vampire=0;

--------------------------------

function newday ()
    if GetObjectiveState("cabin", PLAYER_1)=OBJECTIVE_ACTIVE then   
        update_obj();
    end;
end;

--------------------------------

function kill_vamp()
    vampire=vampire+1;
    if GetObjectiveState("cabin", PLAYER_1)=OBJECTIVE_ACTIVE then   
        update_obj();
    end;
end;

--------------------------------

function update_obj()
    if vampire==0 then
          SetObjectiveProgress("cabin", PLAYER_1, 0);
    end;
    if vampire==1 then
          SetObjectiveProgress("cabin", PLAYER_1, 1);
    end;
    if vampire==2 then
          SetObjectiveProgress("cabin", PLAYER_1, 2);
    end;
    if vampire==3 then
          SetObjectiveProgress("cabin", PLAYER_1, 3);
    end;
    if vampire==4 then
          SetObjectiveProgress("cabin", PLAYER_1, 4);
    end;
end;

--------------------------------

Trigger(NEW_DAY_TRIGGER, "newday");


Apart from the main script, I added a line in the combat script of the vampires :

Code: Select all

kill_vamp();


That's probably where I'm wrong.

But, even stranger, when the update_obj is triggering, the console says "ERROR : objective "cabin" is inactive" but IT IS active !

So if anyone can help me clear this mess, thank you in advance because i'm running out of ideas.

myythryyn
Assassin
Assassin
Posts: 293
Joined: 05 Sep 2006

Postby myythryyn » Dec 19 2006, 20:46

if no one is able to provide a way to get your script working Marzhin i can give you an alternative.

i also tried to do the same thing and was not able to get the objective progress commands to work. in the map i made i had an objective to secure one of each mine. after they capture six in any order, the objective completes.

this is what i did. i set up a variable, then a manual objective, and activated it. Then each time the player touched a mine i used the object touch trigger to run a script that added +1 to the variable. i also put a check in the same script that checks if the variable is equal to 6.
if so, then the manual objective completes and a message is shown and whatever rewards are given.
if you want an exact script example i can give one.

now for your vampires, maybe you can put them in garrison's. this way, when the player defeats the vampire, and touches the garrison, that could be your trigger. or you could create a small region on the square that the vampires occupy so the player triggers the script when they enter that square.

or maybe someone can let us know how to get objective progress steps to work :)

User avatar
Marzhin
Pit Lord
Pit Lord
Posts: 1204
Joined: 06 Jan 2006
Location: Montreuil, France
Contact:

Postby Marzhin » Dec 19 2006, 21:07

myythryyn wrote:if no one is able to provide a way to get your script working Marzhin i can give you an alternative.

i also tried to do the same thing and was not able to get the objective progress commands to work. in the map i made i had an objective to secure one of each mine. after they capture six in any order, the objective completes.

this is what i did. i set up a variable, then a manual objective, and activated it. Then each time the player touched a mine i used the object touch trigger to run a script that added +1 to the variable. i also put a check in the same script that checks if the variable is equal to 6.
if so, then the manual objective completes and a message is shown and whatever rewards are given.
if you want an exact script example i can give one.


Thanks :D
Actually I think my script works very much the same way. I have the variable (called "vampire" in the script), the script that adds +1 to this variable, and so on. I think I'll try using regions.

User avatar
Pitsu
Round Table Hero
Round Table Hero
Posts: 1823
Joined: 22 Nov 2005

Postby Pitsu » Dec 19 2006, 21:27

Following sample should work for 4 removable items with 4 different objective progression state. Pretty much copy-paste for Marzin. The objects (vampire stacks on adventure map) are named as vamp1, vamp2 vamp3 and vamp4.

Code: Select all

oldvalue =0;

function vampquest()
   while 1 do
   killed = 0;
        if GetObjectiveState("cabin", OBJECTIVE_ACTIVE) then
   for i= 1, 4 do
      if IsObjectExists("vamp"..i) == nil then
         killed = killed +1;
      end;
   end;
   print("killed : ", killed);
   if oldvalue ~= killed then
      oldvalue = killed;
      SetObjectiveProgress ("cabin", killed);
   end;
end;
sleep(5);
end;
end;

startThread(vampquest);


Edit. The startThread command may go to the script where "cabin" objective is ACTIVATED. And one can have more than 4 vamp# stacks, but when the killed amount turns higher than defined objective progress states an error will occure. You need an additional checking in the script in that case. For unremovable objects, like mines, use owner check instead of IsObjectExists.

Edit2. A slightly more economic version (should not use CPU when objective is not active), but now it is a *must* to have startThread(vampquest); triggered after the objective is *activated* not any time like in previous sample:

Code: Select all

oldvalue =0;

function vampquest()
   while GetObjectiveState("cabin", OBJECTIVE_ACTIVE) do
   killed = 0;
   for i= 1, 4 do
      if IsObjectExists("vamp"..i) == nil then
         killed = killed +1;
      end;
   end;
   if oldvalue ~= killed then
      oldvalue = killed;
      SetObjectiveProgress ("cabin", killed);
   end;
sleep(5);
end;
end;
Avatar image credit: N Lüdimois

User avatar
Marzhin
Pit Lord
Pit Lord
Posts: 1204
Joined: 06 Jan 2006
Location: Montreuil, France
Contact:

Postby Marzhin » Dec 19 2006, 22:27

I'll try it , thanks Pitsu ^^

myythryyn
Assassin
Assassin
Posts: 293
Joined: 05 Sep 2006

Postby myythryyn » Dec 20 2006, 5:30

hi, any way to stop the player from recieving enemy AI hero's artifacts after battle?

i tried selecting "untransferrable", but the player still recieves all the artifacts.

i could make a script that removes the artifacts after battle, but i think that would be annoying when they get the messsages that you found artifacts, only to have them removed right away....

so am i missing a setting that does not allow AI hero artifacts to be picked up by the player?


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 3 guests