Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Tournament of Honor > Thread: Scripting problem
Thread: Scripting problem
re-animator
re-animator


Adventuring Hero
posted October 04, 2002 08:51 PM

Scripting problem

I realize that this would probably better fit in the Library, but it seems to me that ToH mapmakers would more likely read this here.

To make recurring events I've been writing scripts within the triggerable portion of quest huts (as opposed to the completion portion) and have encountered a problem.  After fighting any Combat triggered by answering yes to the Ask Question script, the If Victorious portion of the Branches section doesn't trigger.  Has anyone else encountered this and figured out a way to fix it?

What I've been trying to do is create a couple of objects that will simulate generators for all six of the generator-less creatures (Sea-monsters and Mermaids as well as the creatures from TGS).  I've been able to do it well if I separate the battle portion in a Quest Guard and the purchase part in a Quest Hut, but that's unsatisfying.

Additionally, I created a Prison with Timed events to set initial variables (so you can import the Prison to any map instead of having to alter each map in the map properties section).  This seems to be working fine so that's not the problem.

I'm hoping that eventually some Web site (like ToHeroes) will host a map filled with custom made scripts for others to use in their maps.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Thunder
Thunder


Responsible
Famous Hero
posted October 04, 2002 09:21 PM
Edited By: Thunder on 4 Oct 2002

Actually, I reckon that the best place to go for advices in map editor is Map Making Guild in Round Table Forums.

I haven't encountered the combat bug, but have heard of it several months ago. The answer is quite simple, you don't really need those branches. Just put the actions in sequence.

Like this:
(Sequence)
This army fights 100 Titans.
Give 10000 gold to the Current Player.
Give Shackles of War to the Current Player.

This ensures that if you win you will always get 10000 gold and Shackles of War. But if you lose, you wont.

If you need creature generator quest hut that is little like real dwellings then you can make the following script (this is only for players Red and Blue):

Quest Hut:
If Colour of Current Player is Red and not Red_Controls then (Sequence) If current week < 2 then this army fights 4 Sea Monsters else If Current Week >= 2 then this army fights 10 Sea Monsters, Set Red_Controls True, Set Blue_Controls False.
If Colour of Current Player is Blue and not Blue_Controls then (Sequence) If current week < 2 then this army fights 4 Sea Monsters else If Current Week >= 2 then this army fights 10 Sea Monsters, Set Blue_Controls True, Set Red_Controls False.
If Colour of Current Player is Red and Red_Controls then If Sea_Monster > 0 then Ask Question "Do you want to recruit Sea Monster for 4000 gold?". If Yes then If Quantity of Gold Current Player Has >= 4000 then (Sequence) take 4000 gold, give 1 Sea Monster.
If Colour of Current Player is Blue and Blue_Controls then If Sea_Monster > 0 then Ask Question "Do you want to recruit Sea Monster for 4000 gold?". If Yes then If Quantity of Gold Current Player Has >= 4000 then (Sequence) take 4000 gold, give 1 Sea Monster.

For dwelling growth you need another script.

Timed Event (happens every week):
Set Sea_Monster to Sea_Monster +2.

Make sure that you make the timed event occur only once per week, or their weekly growth is more than 2 (or reduce weekly growth).

Of course, there are other ways to script that hut. This was just one of the possibilities.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
re-animator
re-animator


Adventuring Hero
posted October 04, 2002 09:47 PM

I'll reply one time here and then go to Round Tables

To mirror accurate growth I've been using a script that looks like this (this for Dark Champions):

set 'dcavailable' = 2
set 'dcpurchased' = 0

then after you buy one Dark Champion (using give and take scripts and adding one to 'dcpurchased')

set 'dcavailable' = 'dcavailable' + ('currentday' - 'dcvday')/4 - 'dcpurchased'

where 'dcvday' was the day you conquered the hut and 'currentday' is set day one and increases every day.

This allows Dark Champions to accumulate, but also takes into account any that are purchased.

Anyway, I still think it'd be a good idea for ToH to host a section with common script scenarios for MP maps.

____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Thunder
Thunder


Responsible
Famous Hero
posted October 04, 2002 10:06 PM
Edited By: Thunder on 4 Oct 2002

Quote:
Anyway, I still think it'd be a good idea for ToH to host a section with common script scenarios for MP maps.



It is. I haven't argued against it. They can also be copied from the existing maps. But come to think of it, I doubt that I have made any COMMON scripts to my maps (except creature growth handler). Maybe others have.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
angelspit
angelspit


Famous Hero
Warrior of the Heavens
posted October 04, 2002 10:30 PM

I can host this section. However, I cannot build it myself, having zero experience in the mapmaking area. Any volunteer out there?
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Re-Animator
Re-Animator


Adventuring Hero
posted October 05, 2002 02:11 AM

I'll send you a map

Quote:
I can host this section. However, I cannot build it myself, having zero experience in the mapmaking area. Any volunteer out there?


I've spoken with Sir Charles over at H3Trio (I think that's it) and I'm going to send him the map I have with my various script objects (once I guarentee that they work exactly as expected) and I can e-mail the map to you too.  I think Ungo over at MMportals is interested too.  There's no reason why multiple sites can't host these script containing maps and periodically update each others' maps.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
DonGio
DonGio


Promising
Famous Hero
of Clear Water Mountain Clan
posted October 05, 2002 09:55 AM

This seems like an excellent idea. And thanks to Angelspit for being a good sport (or something).

I haven't used the map editor as much as I'd have liked (partially due to my disappointment with the game), however I am fairly new to this scripting, and it sounds like a section like this would be really helpful.

How about adding a couple of beginner lessons in scripting?

Edit well
DonGio
____________
There are 10 types of people: Those who read binary, and those who don't.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jex
Jex


Known Hero
posted October 05, 2002 10:22 AM

yea I found the same thing and some others which were posted in the HC map council thread.

I just stopped putting fights in placed events. Which suxs cause now they take up space now on the map.

But what Thunder said wont work. It only triggers a 'reward' script if you lose the fight. So that doesnt work to place monsters in Pandie boxes.

By the way one that should go on the future page is: to make all additions and subracts of troops, arties, morale, luck, etc, everything I can, with the 'Display Message' script. You haveta put some message in the text window tho. Even if it is just something like 'Transaction'. This script causes a message window to tell the player what just happenned. Making your scripts much more user friendly.
This one is a must try

Oh and I can now upload a map with 4 different variables so a person could place 4 refugee camps on a map. Man, those were tedious
Thats about all I know and have donen recently.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Thunder
Thunder


Responsible
Famous Hero
posted October 05, 2002 10:43 AM

You are right, I just tested it out. It seems that only way to make it in the hut, is to make a script that checks whether there are creatures left or not. Unfortunately, that won't work with heroes as Total Number of Heroes count for both alive and dead heroes.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Angelspit
Angelspit


Famous Hero
Warrior of the Heavens
posted October 06, 2002 06:00 AM

Quote:
I can e-mail the map to you too. There's no reason why multiple sites can't host these script containing maps and periodically update each others' maps.

Sure, why not? Please send the map my way. Thanks.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
2XtremeToTake
2XtremeToTake


Promising
Supreme Hero
posted October 06, 2002 06:02 AM

tell me.......are you angels pit? or angel spit??   lol jk
____________
I almost had a psychic girlfriend but she left me before we met.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0373 seconds