|
Thread: Scripting problem | |
|
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.
____________
|
|
Thunder
Responsible
Famous Hero
|
posted October 04, 2002 09:21 PM |
|
|
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.
____________
|
|
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.
____________
|
|
Thunder
Responsible
Famous Hero
|
posted October 04, 2002 10:06 PM |
|
|
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.
____________
|
|
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?
____________
|
|
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.
|
|
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.
|
|
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.
|
|
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.
____________
|
|
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.
____________
|
|
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.
|
|
|