Heroes V map editor questions

Maps and the art of mapmaking.
User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 30 May 2009, 17:52

each sound effect comes little delay, why? not see any problem about code...
function gotinambush(h,rg)
-- when trigger REGION_ENTER_.... is called, it passes two parameters
-- to the fuction: name of a hero who entered the region and the region name.
-- So h holds heroname, and rg - region name.
if h == "Nicolai" then
CreateMonster('ambushdevil', CREATURE_ARCHDEVIL, 10, 89, 98, 0, MONSTER_MOOD_AGGRESSIVE, MONSTER_COURAGE_ALWAYS_FIGHT, 0);
--CreateMonster function sometimes places monsters
-- in a wrong place. So you should always follow it with SetObjectPosition:
sleep(1);
SetObjectPosition('ambushdevil',89,98,0);
PlayVisualEffect( "/Effects/_(Effect)/Spells/weakness.xdb#xpointer(/Effect)", "ambushdevil");
Play2DSound( "/Sounds/_(Sound)/Spells/weakness.xdb#xpointer(/Sound)");
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "regionbox1", nil );
if h == "Nicolai" then
CreateMonster('ambushdevil', CREATURE_ARCHDEVIL, 10, 88, 97, 0, MONSTER_MOOD_AGGRESSIVE, MONSTER_COURAGE_ALWAYS_FIGHT, 0);
sleep(1);
--CreateMonster function sometimes places monsters
-- in a wrong place. So you should always follow it with SetObjectPosition:
sleep(1);
SetObjectPosition('ambushdevil',88,97,0);
PlayVisualEffect( "/Effects/_(Effect)/Spells/weakness.xdb#xpointer(/Effect)", "ambushdevil");
Play2DSound( "/Sounds/_(Sound)/Spells/weakness.xdb#xpointer(/Sound)");
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "regionbox1", nil );
end;
end;
end;
Trigger( REGION_ENTER_AND_STOP_TRIGGER, "regionbox1", "gotinambush" );

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 01 Jun 2009, 08:40

The script looks just fine, except for two sleep(1)'s following one another - you only need one.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 01 Jun 2009, 12:31

ok thx. well i soleved it removing all other sounds than one :) because they spawned same time.

another question. i am asked this earlier also but i ask again..

1. how i make real ambush that when i step to region, fighting starts instantly, like events in heroes 3 :) if u remember those.

and how i set monsters who attack, can i set them?

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 01 Jun 2009, 14:13

There is a function StartCombat that allows you to start a combat instantly. You can set number, type and amount of troops to fight, arena, hero (if needed) and even special combat script.

Here is an example:

Code: Select all

function ambushguardsdefeated(h,rst)
--This function is called after the battle
  if (rst~=nil) then
    --hero won, this check is _essencial_
    MessageBox....
    GiveExp(h,1000);
  end;  
end;

function myambush(h)
  MessageBox...
  StartCombat(h, nil, 4, CREATURE_SWORDSMAN, 50, CREATURE_MARKSMAN, 40, CREATURE_ZEALOT, 3, CREATURE_LONGBOWMAN, 30, nil, "ambushguardsdefeated", nil, not nil);
end;

Trigger(REGION_ENTER_AND_STOP_TRIGGER,"ambushregion","myambush");
Also, there is function MakeHeroInteractWithObject. Just place an army anywhere on the map (in unaccessible area) and use the mentioned function when hero enters the region. This way you can easily make ambush strength automatically grow with time and also use random creatures, etc.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 01 Jun 2009, 14:43

ok thx i try later, but i was wondering to make new primary quests and secondary also. but on maps what i have looked was so hard to understand how they have do it actually.

so i want secondary and primary quests come without any object to touch, they just popup when i step some where.. guess need region script but thats it i not know more to do..

anyway i need explaining how to make script to rescue some one, somewhere and find something afrtifact before to get rescue (key)

if here is same kind script asked before, sorry for post...

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 01 Jun 2009, 16:01

Just devide your ideas into smaller tasks and everything will get simple. What you ask is something from an old russian tale: Go I don't know where, fetch me I don't know what (you know, where princess gives this task to a knight to get rid of him).

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 01 Jun 2009, 16:58

well, lol dunno script codes to do that

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 01 Jun 2009, 18:52

this code not work. first textbox come but when actually combat should start it whining that creatures are "nil" or something like that...
function ambushguardsdefeated(h,rst)
--This function is called after the battle
if (rst~=nil) then
--hero won, this check is _essencial_
MessageBox("Maps/SingleMissions/Demon Urgash/hiddenfight.txt");
GiveExp(h,10000);
end;
end;

function myambush(h)
MessageBox("Maps/SingleMissions/Demon Urgash/hiddenfight2.txt");
StartCombat(h, nil, 4, CREATURE_ARCH_DEMON, 50, CREATURE_ARCH_DEVIL, 40, CREATURE__SUCCUBUS_SEDUCER, 60, CREATURE_ARCH_DEVIL, 55, nil, "ambushguardsdefeated", nil, not nil);
end;

Trigger(REGION_ENTER_AND_STOP_TRIGGER,"ambushregion","myambush");

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 02 Jun 2009, 05:37

You got it wrong. CREATURE_XXX is not a random collection of letters, these are defined constants. For example, CREATURE_ROYAL_GRIFFIN = 8, and that's the ID of Royal Griffin. They are used to make scripts more readable. However, don't try to guess. You tried - and failed. Look up these constants and ID's in the files common.lua and advmap-startup.lua (in the game data file, which is a simple zip archive). Otherwise, refer to file HOMM5_A2_IDs_for_Scripts.pdf, though be warned that it contains a number of misprints.

So, you need these ids:
CREATURE_ARCHDEVIL
CREATURE_SUCCUBUS_SEDUCER
CREATURE_ARCH_DEMON

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 02 Jun 2009, 11:58

well dont understand you now..
(quote]StartCombat(h, nil, 4, CREATURE_SWORDSMAN, 50, CREATURE_MARKSMAN, 40, CREATURE_ZEALOT, 3, CREATURE_LONGBOWMAN, 30, nil,[/quote]

are those numbers ID's or amount of creatures and if is, do i make code example like this then?
StartCombat(h, nil, 4, CREATURE_SUCCUBUS_SEDUCER = 134, 50, CREATURE_ARCH_DEMON = 137, 40, CREATURE_ARCHDEVIL = 28, 3, CREATURE_ARCHDEVIL = 28, nil,

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 02 Jun 2009, 12:11

No, like this:

StartCombat(h, nil, 4, CREATURE_ARCH_DEMON, 50, CREATURE_ARCHDEVIL, 40, CREATURE_SUCCUBUS_SEDUCER, 60, CREATURE_ARCHDEVIL, 55, nil, "ambushguardsdefeated", nil, not nil);

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 02 Jun 2009, 13:37

so numbers are amounts? and i need only that code in script, i mean i not need any monsters "hiding" on map.
this script line create monsters?

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 02 Jun 2009, 15:28

This line does not create monsters, it just starts combat.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 02 Jun 2009, 18:48

so what are those number before "creature_bla_bla" ? and... i need those type monsters in map to "call" them with script or what?

sorry im totally out now..

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 02 Jun 2009, 19:26

Read the function description in the manual, and everything will get clear.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 02 Jun 2009, 20:38

well scripth work now, and i only paste u scrip what u send me just :) dunno still how u make it but i can use it for a example for my other hidden combats, thank you very much !

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 03 Jun 2009, 09:53

For gods sake, read the manual at last. It has almost everything you need to know. There is no magic about the scripts, you don't have to dance around with a tambourine to make it work - you just have to look up function syntax and description, and study a few examples. If you want to become a mapmaker you have to understand how the things work, not just copy/paste someone else scripts.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 03 Jun 2009, 13:30

hmm who sayed that im NOT have look those fucking manuals. and as u see im not good in english or a this editor like you are, and i guess this place is for asking question? i not ask if im not figured it out myself.
and even i have got help here, this forum. some scripts not worked in first time i try. so its need some attention much to make things right and some knowledge to add things right.

when i first time look script manual i thinking OMFG what a nerd language but now when i am little got in :D i am get some courage to make scripts also, because i want good visual and story maps.

and even manual have example something, its not say me which order (if multiple things) i add them.
i have another question but perhaps i not bother you of it, because its so dump question.

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 03 Jun 2009, 14:12

If you want to learn something, you must try to understand how the given example works. To do that, you should look up descriptions of all the functions you see in the example. That's what I meant when I said you should read the manual. Then you will have no questions what he numbers mean.

User avatar
Belchior
Peasant
Peasant
Posts: 57
Joined: 17 May 2009
Location: Finland
Contact:

Unread postby Belchior » 03 Jun 2009, 17:04

jep jep..but lol i have problem. ( 30 minutes checking)

what a fuck is wrong this code.. it should be show place where bricks "explode" when i talk to "bathos" and then move camera back to hero.

error report is just "excepted ";" " do string script bla bla

it means that i need only add ; on current line? duh...but there is that f* ;) on that line lol...
function bathostalk(h)
if h == "Nicolai" then
MessageBox("Maps/SingleMissions/Demon Urgash/talkbathos.txt" );
MoveCamera(24, 152, 0, zoom = 50, pitch = pi/2, yaw = 0, noZoom = 0, noRotate = 0);
RemoveObject("blockstone");
PlayVisualEffect( "/Effects/_(Effect)/Spells/meteorshower.xdb#xpointer(/Effect)", "blockstone");
Play2DSound( "/Sounds/_(Sound)/Spells/meteorshower.xdb#xpointer(/Sound)");
RemoveObject("blockstone");
sleep(10);
MoveCamera(111, 36, 0, zoom = 50, pitch = pi/2, yaw = 0, noZoom = 0, noRotate = 0);
RemoveObject("bathos");
PlayVisualEffect( "/Effects/_(Effect)/Spells/BLESS.xdb#xpointer(/Effect)", "bathos");
Play2DSound( "/Sounds/_(Sound)/Spells/BLESS.xdb#xpointer(/Sound)");
end;
end;
SetObjectEnabled("bathos",nil)
Trigger(OBJECT_TOUCH_TRIGGER,"bathos","bathostalk");


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 0 guests