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" );
Heroes V map editor questions
each sound effect comes little delay, why? not see any problem about code...
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?
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?
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:
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.
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");
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...
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...
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");
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
So, you need these ids:
CREATURE_ARCHDEVIL
CREATURE_SUCCUBUS_SEDUCER
CREATURE_ARCH_DEMON
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?
(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,
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.
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 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.
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 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.
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...
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");
Who is online
Users browsing this forum: Bing [Bot] and 0 guests