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 > Heroes 4 - Lands of Axeoth > Thread: Random Scripting Questions
Thread: Random Scripting Questions
Khaelo
Khaelo


Honorable
Supreme Hero
Underwater
posted December 02, 2002 10:25 AM

Random Scripting Questions

An Addendum to "Beginner's Guide to Scripting."

This is a thread for those random and/or strange questions that arise while one is trying to make one's vision into reality using the Heroes 4 map editor.  Post your dilemma here (instead of making another thread for every new and bizarre situation), and with any luck, a mapmaking guru can help you.

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


Honorable
Supreme Hero
Underwater
posted December 02, 2002 10:35 AM

"Be Kind, Rewind" this hero

(Also known as "Motive for Creating this Thread"  I can't be the only person who thinks up stuff like this, then has trouble making it work...)

Is it possible to take a hero away from a player in the middle of a scenario?  My idea is to "lend" the player a hero with Grandmaster Seamanship.  This guy is supposed to help the campaign hero around an extensive water section, and then he goes away again.  I know how to make such a hero join the player's color in the first place.  Unfortunately, I don't know how to make the player give him back!  I've tried using a placed event to trigger a color change on the borrowed hero, but it doesn't trigger for some reason.  This may have something to do with the fact that the borrowed hero is in a larger army, and I can't destroy or take away the rest of the army.  What now?

Secondary option would be to "lend" Grandmaster Seamanship to the campaign hero himself, although that would be more difficult to explain story-wise.  Is that feasible?
____________
 Cleverly
disguised as a responsible adult

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


Known Hero
who loves to script.
posted December 02, 2002 01:42 PM

Khaelo I think I might have a solution to your problem. It seems like from your post you are having trouble deleting a hero in mid game from an amy. Well if it was me, I would put an event where the hero steps off from the boat, if you can't limit where he gets off just put them all across the coast. Then make the event trigger an event in the hero's event list that makes the hero fight 100 black dragons. This will kill the hero, deleting him from the game. I think this should be a solution to your problem, if not then I'll try again.
____________
guten tag

du bist schwul.

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


Honorable
Supreme Hero
Underwater
posted December 03, 2002 01:37 AM

Quote:
Well if it was me, I would put an event where the hero steps off from the boat, if you can't limit where he gets off just put them all across the coast.


Got this part.  

Quote:
Then make the event trigger an event in the hero's event list that makes the hero fight 100 black dragons. This will kill the hero, deleting him from the game.


But won't that make the whole army, controlled by the player and probably containing the campaign hero, face the 100 dragons?  I don't want to destroy the whole army, nor do I want the player controlling the borrowed hero in his last great battle.

What I tried was the following:

Triggerable Event "leave" on hero.  Script is a Sequence.  First, Display Message ("goodbye").  Second, Change Owner to No Player.  Third, Combat: This Army vs. 1000 Titans.

Placed Events "sailor2" sitting where army cannot possibly avoid stepping on one.  Sequence Script again -- First, Trigger Custom Event "leave." Second, Remove Script.

Result:  In the first trial, it displayed "goodbye," then the whole army vanished into thin air -- target hero, companion hero, troops, everything.  In the second trial, it didn't trigger at all (the script hadn't been changed, but my laptop had gotten more moody...).  I couldn't test your suggestion, since that one wasn't triggering either.  But I do think the player would be stuck facing the 100 dragons/1000 titans or whatever.
____________
 Cleverly
disguised as a responsible adult

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


Known Hero
who loves to script.
posted December 03, 2002 02:00 AM

Hmm I tried out my hypothesis of your problem, and it turned out that it didn't work. I am puzzled by this problem, but will keep looking for a solution. I have several leads that might work, but none are ready to be given. I'll talk back with you tomorrow if I find a solution.
____________
guten tag

du bist schwul.

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


Honorable
Supreme Hero
Underwater
posted December 10, 2002 11:05 PM

new question

Okay, forget the loaner hero; the first map in the campaign is having big issues.

The objective is for the player to go find a bunch of wandering Efreeti and get them to join.  Since simply having the Efreeti's color change upon encounter does not work (they fight the player anyway), the script I'm using now is the following:

On Wandering Efreeti --
1)  Standard Events/Encountered/Script/Sequence
Conditional Action: IF Opposing Army has hero "Moandor" AND Opposing Army possesses Ring of the Cobra's Eye THAN Ask "[blah blah blah?]", if yes then Display "[blah blah blah]; Trigger Custom Event named "Giveefreeti"; Trigger Custom Event named "Killefreeti"; Remove Script.  ELSE Do Nothing.
2)  Triggerable Events/killefreeti/Script/Combat
Target This Army; Opponents 1000 Titans.

On Hero Moandor --
1) Triggerable Event/Giveefreeti/Give Creatures
Target This Army; Creature Type Efreeti; Quantity 12.

---
When I started playtesting this, on test maps w/out cheat codes and on the actual map w/ cheat codes, it asked the question, Moandor got his 12 efreeti, and the real efreeti from the Adventure map disappeared.  It worked whether Moandor attacked the efreeti, or they attacked him.  Most of the time, it displayed that fight/flee window, but there was never a combat.  The cheat codes I was using were Ares (win combat) and Hermes (unlimited movement), in order to save real time.  My comp is at Heroes IV's minimum requirements, so the game slows down considerably the longer I play, despite being patched.  Needless to say, this makes testing considerably more frustrating, so I use the cheats to make the early stages easier on myself.

On playtests with no cheat codes, however, the script started to break.  My brother got the efreeti, but faced a combat screen vs. NOTHING.  After his glorious triumph over the invisible opponents (who wouldn't even show their faces on the victorious combat screen!), he carried on with no problem.  He'd been playing about a real-time hour, and the game was still playing reasonably well.  After a later script crashed the game, I adjusted that other script, which didn't affect the efreeti one, and went through another cheatless test.  This time, I got no efreeti at all, but still faced the invisible opponents.  New game, cheat codes back, efreeti worked.  New game, no cheat codes, no efreeti.  I assumed the computer's memory or something was the culprit, so I restarted the laptop.  The first cheatless playtest --> broken efreeti.  Cheating playtest --> working efreeti.  Restart again; check out script to make sure it's still the same.  It is.  New cheatless test --> the efreeti work!  Voila; they can behave themselves after all!  I put the problems down to a moody laptop and asked for outside playtesters (which I would never have done if I thought this critical script was broken unto itself).

Now, csarmi reports that the efreeti are broken on his tests!  I don't get it!  That's obviously not due to my comp's "personal issues."  Is the script too complicated?  What's going wrong here?!?
____________
 Cleverly
disguised as a responsible adult

 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.0288 seconds