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 3.5 - WoG and Beyond > Thread: help with a script
Thread: help with a script
minieminem
minieminem

Tavern Dweller
posted February 06, 2005 12:10 AM

help with a script

is there a way to stop a heros movement on the adventure screen? ive tried everything.

im trying to make a script where retreating just makes you leave battle and keep creatures instead of leaving the map.

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


Promising
Famous Hero
posted February 06, 2005 04:10 AM

Quote:
is there a way to stop a heros movement on the adventure screen? ive tried everything.

im trying to make a script where retreating just makes you leave battle and keep creatures instead of leaving the map.


Setting a hero's movement points to 0 should stop it moving any further in that turn, but if you do this in an HM trigger, you still won't be able to stop the hero taking the very next "step"--as far as I know there's no way to prevent that.


____________

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


Promising
Famous Hero
posted February 06, 2005 04:12 AM

Quote:
is there a way to stop a heros movement on the adventure screen? ive tried everything.

im trying to make a script where retreating just makes you leave battle and keep creatures instead of leaving the map.


Setting a hero's movement points to 0 should stop it moving any further in that turn, but if you do this in an HM trigger, you still won't be able to stop the hero taking the very next "step"--as far as I know there's no way to prevent that.


____________

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


Promising
Famous Hero
posted February 06, 2005 04:13 AM

Quote:
is there a way to stop a heros movement on the adventure screen? ive tried everything.

im trying to make a script where retreating just makes you leave battle and keep creatures instead of leaving the map.


Setting a hero's movement points to 0 should stop it moving any further in that turn, but if you do this in an HM trigger, you still won't be able to stop the hero taking the very next "step"--as far as I know there's no way to prevent that.


____________

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

Tavern Dweller
posted February 08, 2005 03:24 AM

thanks for the input, already tried that. when the hero has further movement, after battle continues movement. (i use random enemy encounters on the map.) thats the problem i have. i want, after the battle, the hero to stop movement completely, i tried !!HE-1:W0; and set hero patrol to 0 squares, neither work, unless im doing it wrong.

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


Promising
Famous Hero
posted February 08, 2005 03:43 AM

Quote:
thanks for the input, already tried that. when the hero has further movement, after battle continues movement. (i use random enemy encounters on the map.) thats the problem i have. i want, after the battle, the hero to stop movement completely, i tried !!HE-1:W0; and set hero patrol to 0 squares, neither work, unless im doing it wrong.


When you set it to 0, the hero takes only one more step, right?

But it sounds like what you need is a way for the hero to pause on the battle square, and not continue moving until the player clicks another place to move to (or even to have no more movement that turn). Is this right?

If so, I think you could do it the same way I did it in my Passable Terrain script--in that script, you may encounter a battle while moving through forest or trees and I wanted the hero to stop (or pause) after the battle.

To solve the problem, I trigger the battle with the HM (hero movement) trigger, but place a sign temporarily at the battle location with the UN:I command. Then after the battle, the hero stops at the sign, which I then remove. You can check the Passable Terrain script for more details.

I hope this helps.

____________

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

Tavern Dweller
posted February 08, 2005 03:55 AM

thanks. never thought of putting an object then removing it. does the message from the sign show up or not?

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


Promising
Famous Hero
posted February 08, 2005 05:05 AM

Quote:
thanks. never thought of putting an object then removing it. does the message from the sign show up or not?


No, the sign message doesn't display with the way I did it, which, to be honest, I don't recall all the details now. But you should be able to figure it out from my code and with luck it will  work just as well for your script too.

Ideally I would have placed an event instead of a sign, but we don't yet have a generic trigger for an event that we don't know the location of (maybe in 3.59 if we're lucky).

If you enable Passable Terrain and try moving through the trees until you encounter something, you should very briefly see the sign appear if you look closely. You could also experiment with another object instead.


____________

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


Hired Hero
posted February 09, 2005 05:20 AM

Quote:
Ideally I would have placed an event instead of a sign, but we don't yet have a generic trigger for an event that we don't know the location of (maybe in 3.59 if we're lucky).



untested, but shouldn't !?OB26; catch triggered events?

any why didn't you know location? does v998,v999,v1000 hold the spot the hero is moving to or from? do we have special variables for from and to or just whichever one v998/v999/v1000 is?
____________

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


Promising
Famous Hero
posted February 09, 2005 07:38 AM

Quote:
untested, but shouldn't !?OB26; catch triggered events?

any why didn't you know location? does v998,v999,v1000 hold the spot the hero is moving to or from? do we have special variables for from and to or just whichever one v998/v999/v1000 is?


!?OB26; doesn't work (events are a bit different from other objects)--maybe in 3.59 (it's on our ERM wish list for Slava).

I meant that I didn't know the location before writing the script--you can't use variables for coordinates in a trigger.


____________

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


Hired Hero
posted February 09, 2005 06:14 PM

you can't use !?LEv998/v999/v1000; ? most of the time nothing would happen because there's no event there, but shouldn't it work when the heroe's coordinates match up with a real event?

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


Promising
Famous Hero
posted February 09, 2005 08:41 PM

Quote:
you can't use !?LEv998/v999/v1000; ? most of the time nothing would happen because there's no event there, but shouldn't it work when the heroe's coordinates match up with a real event?


No, triggers can't be variables. It's just the way ERM works--the triggers have to all be set up at the start of the game and they can't be dynamically set through the use of variables.

If you try to use variables in trigger parameters, you'll either get an error, or it may ignore the letter part and just use the numbers (which might produce an error anyway if the numbers are too large). For example, if you had an x/y/level location stored in v1/v2/v3 and put !?LEv1/v2/v3; it might interpret it as !?LE1/2/3;

The bottom line is that all trigger parameters must be  constants. From what Slava's told me in the past, I doubt this could be changed.


____________

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

Tavern Dweller
posted February 10, 2005 03:01 AM
Edited By: minieminem on 9 Feb 2005

i still cant get the hero to stop! i keep, thinking of new things to try, but none work... keep getting errors, or the hero just doesnt stop.

also, is there a way to set map difficulty with ERM? i tried the !#UN:J2.... method, doesnt work somehow.

if i could get past this script, ill be able to work more on the rest of my map, it should be done in a week or so. its more adventure oriented than strategy. for example, heros are portrayed by creatures, and can be equipped with weapons and armor. lots of quests and a few extra features.

now if i could only get past that script...

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


Promising
Famous Hero
posted February 10, 2005 07:22 AM

Quote:
i still cant get the hero to stop! i keep, thinking of new things to try, but none work... keep getting errors, or the hero just doesnt stop.

also, is there a way to set map difficulty with ERM? i tried the !#UN:J2.... method, doesnt work somehow.

if i could get past this script, ill be able to work more on the rest of my map, it should be done in a week or so. its more adventure oriented than strategy. for example, heros are portrayed by creatures, and can be equipped with weapons and armor. lots of quests and a few extra features.

now if i could only get past that script...



Did you try the method I used in Passable Terrain?  That seems to work fine.

I've never set the difficulty level with UN:J2. I believe someone on the team tested it and said it seemed to work. Slava wrote that the game may not keep the value set always so to be careful. Perhaps what you could do is try setting it with a !?PI; (post-instruction) trigger and then check if it keeps the new value. Then set it again every turn with a daily Timer.


____________

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

Tavern Dweller
posted February 11, 2005 04:24 AM

never knew there was a PI trigger... ill try it.

as for the other matter... i got the hero to stop... only, after the battle, if the hero retreats (which is what the script is used for) when u click on the hero, there is a duplicate hero created on top of him....????
when i move the hero, the other stays put but faces to the diretion the moving hero is facing. why is that?

thanks for the help.

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


Adventuring Hero
posted February 16, 2005 03:19 AM

Is it possible to ban a secondary skill from appearing when heroes level up ???
I've tried !#UN:S22/1; however it does not work ...

!#UN:A87/1; -->>> this bans an artifact ... So is skill baning possible ??
Maybe it is possible to do something with a skill to become like necrmomancy available only for one hero type ???

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

Tavern Dweller
posted February 16, 2005 05:56 AM

you can change that in map editor, unless its not for a particular map

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


Promising
Famous Hero
posted February 16, 2005 07:51 AM

Quote:
never knew there was a PI trigger... ill try it.

as for the other matter... i got the hero to stop... only, after the battle, if the hero retreats (which is what the script is used for) when u click on the hero, there is a duplicate hero created on top of him....????
when i move the hero, the other stays put but faces to the diretion the moving hero is facing. why is that?

thanks for the help.


I'm not sure why that's happening. Sorry. I know it's difficult to get heroes to stop at the moment.

Perhaps we'll eventually have a better way of doing it.


____________

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


Promising
Famous Hero
posted February 16, 2005 07:52 AM

Quote:
never knew there was a PI trigger... ill try it.

as for the other matter... i got the hero to stop... only, after the battle, if the hero retreats (which is what the script is used for) when u click on the hero, there is a duplicate hero created on top of him....????
when i move the hero, the other stays put but faces to the diretion the moving hero is facing. why is that?

thanks for the help.


I'm not sure why that's happening. Sorry. I know it's difficult to get heroes to stop at the moment.

Perhaps we'll eventually have a better way of doing it.


____________

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


Promising
Famous Hero
posted February 16, 2005 07:52 AM

Quote:
never knew there was a PI trigger... ill try it.

as for the other matter... i got the hero to stop... only, after the battle, if the hero retreats (which is what the script is used for) when u click on the hero, there is a duplicate hero created on top of him....????
when i move the hero, the other stays put but faces to the diretion the moving hero is facing. why is that?

thanks for the help.


I'm not sure why that's happening. Sorry. I know it's difficult to get heroes to stop at the moment.

Perhaps we'll eventually have a better way of doing it.


____________

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