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: Elites & Immortality
Thread: Elites & Immortality
Brian_the_Fist
Brian_the_Fist


Hired Hero
posted January 01, 2005 08:59 PM

Elites & Immortality

When a random skill is chosen (for hidden skill), how to loop choice function until it's a skill not yet obtained?
How to make witch huts, Universities, Schools of Magic teach skills above 8th?
How to disable banning players from land / place new hero when a colour's last is slain?
What are the special ability ##?

____________
Bring out number weight & measure in a year of dearth.

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


Hired Hero
posted January 03, 2005 09:39 PM
Edited By: numi on 3 Jan 2005

1: i'd probably use a DO loop that start at 1 and runs to 100; if it hasn't found a secondary skill the hero doesn't have after 100 tries, then run a secondary loop from 1 to 28 and check each skill and give the hero the first skill he/she doesn't have. should also add in a way out in case the hero has all 28 skills. (it's cheating, but possible with ERM)

2: how to make places set skills after first 8 obtained: use !!HE-1 : S to force it. There are complications. I think only the first 8 skills listed will be allowed to levelup. This means your hero's 9th/12th/23rd/whatever skill may get stuck on basic forever. not sure since haven't tested.

3: maybe use HE : P; if it's used on a hero who's not on map, it will actually create the hero. you could put this in a post-battle trigger that tests if player has any heroes left. if the hero were created after the last one was lost, but before the computer did a hero and town count, then the player shouldn't be banned. ust make sure to assign this new hero to a player (HE : O), otherwise waste of time and probably crash game.

4: what do you mean special ability ##? if you mean hero specialty, then check out HE : X area of ERM Help.

____________

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


Promising
Famous Hero
posted January 04, 2005 02:56 AM

Quote:
1: i'd probably use a DO loop that start at 1 and runs to 100; if it hasn't found a secondary skill the hero doesn't have after 100 tries, then run a secondary loop from 1 to 28 and check each skill and give the hero the first skill he/she doesn't have. should also add in a way out in case the hero has all 28 skills. (it's cheating, but possible with ERM)


A variation (and the way I usually this sort of thing), is to first generate a random number from 0 to 27 with VR : R and then do a loop starting at that number and going to 27. In the function (DO loop), check for each skill at the loop number (x16) and set a variable or flag if a skill the hero doesn't have is found, then exit (by setting x16 to 999). If no skill is found in the first loop, start a second DO loop with the same function, but running from 0 to the random number chosen.

In this fashion, you a) minimize the number of loops, and b) get a random new skill, since the checking could start at any point.

Quote:
2: how to make places set skills after first 8 obtained: use !!HE-1 : S to force it. There are complications. I think only the first 8 skills listed will be allowed to levelup. This means your hero's 9th/12th/23rd/whatever skill may get stuck on basic forever. not sure since haven't tested.


I'm pretty sure they do advance on levelup, although it's been awhile since I checked.


Quote:
3: maybe use HE : P; if it's used on a hero who's not on map, it will actually create the hero. you could put this in a post-battle trigger that tests if player has any heroes left. if the hero were created after the last one was lost, but before the computer did a hero and town count, then the player shouldn't be banned. ust make sure to assign this new hero to a player (HE : O), otherwise waste of time and probably crash game.


Yes, this sounds like it could work for bringing back a new hero if the last one is defeated.

For the banished part (after losing all towns), there's a much simpler method. There's an OW receiver command for setting the "days to live without a town":  OW : D.  It can also be used to let a player live forever without a town.



____________

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


Hired Hero
posted January 08, 2005 02:50 PM

Immortal but stupid

Thank you for now!

"A variation (and the way I usually this sort of thing), is to first generate a random number from 0 to 27 with VR : R and then do a loop starting at that number and going to 27. In the function (DO loop), check for each skill at the loop number (x16) and set a variable or flag if a skill the hero doesn't have is found, then exit (by setting x16 to 999). If no skill is found in the first loop, start a second DO loop with the same function, but running from 0 to the random number chosen."

--- I pity myself for still not knowing how do it.

"do a loop starting at that number and going to 27. In the function (DO loop),..."

--- How does this loop-from-to-thing work?

"...check for each skill at the loop number (x16) and set a variable or flag if a skill the hero doesn't have is found."
How do I check for a skill?

--- Would you please give me an idea of how to do code that?

==================================================================

"quote:3: maybe use HE : P; if it's used on a hero who's not on map, it will actually create the hero. you could put this in a post-battle trigger that tests if player has any heroes left. if the hero were created after the last one was lost, but before the computer did a hero and town count, then the player shouldn't be banned. ust make sure to assign this new hero to a player (HE : O), otherwise waste of time and probably crash game."
"Yes, this sounds like it could work for bringing back a new hero if the last one is defeated."

I cannot imagine how to do it.
What I did with erm until now is based on commands from premade erms.
How to make this event appear when a last hero dies?
How to find out about his owner?
How to place him on a free square (check square)?
(I'd also like to do a script making roads disappear.)
How to give him creatures of low but adequate power and quantity?
When chosing a hero how to pick him from those not used?
I fear it's by far too much for me to do.

How to disable that 8-skill restriciton for witch huts, Universities, Schools of Magic?

I'd also like to get information on creating special abilities.
What are the numbers of the existing special abilities?
I cannot check for them because text and image must be set up manually.


____________
Bring out number weight & measure in a year of dearth.

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


Hired Hero
posted January 11, 2005 04:29 PM

Trial by Function

I did a function 727 in script 64 to find a new skill.
I can't find my mistake, but i get offered "pathfinding" (/skill 0) always (even when hero has it).

--- Can you please tell me what is wrong?


** function to handle giving a 9th-27th skill to a hero going up a level

!?FU710;

!!VRv549:S0; [count of skills for this hero]
!!DO707/0/27/1; [count the skills]

!!DO727/0/999/1;

!!HE-1:B0/?z352; [get hero name]
!!UN:N4/353/y1; [get skill name]
!!HE-1:R2/?y3; [get hero sex]
!!VRz354&y3=0:Sz101045;
!!VRz354&y3=1:Sz101046;

!!VRy4:Sy1 *3 +3; [get picture of skill]
!!IF:V2/0; [assume won't learn skill]
!!IF&1000/y2=0/v549<=27:Q2/20/y4/2/z101047;
!!IF&-1000/y2=0/v549<=27:V2/1; [AI always learns it]
!!HE-1&2:Sy1/1; [give skill]

** end of function


** function to handle SKILL ADVANCEMENT OFFERING

!?FU727;

!!VRy1:S40 R27; [pick a random skill to offer]

!!VRy1&y1=40:S7;  [wisdom]
!!VRy1&y1=41:S2;  [logistics]
...
!!VRy1&y1=67:S05; [navigation]

!!HE-1:Sy1/?y2; [check for presence of random skill]
!!VRx16&y2=0:S1000; (IF HERO DOES NOT HAVE SKILL EXIT)


** end of function

____________
Bring out number weight & measure in a year of dearth.

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


Hired Hero
posted January 11, 2005 11:36 PM

i haven't been at this long and haven't used Flags at all, but this is more or less the way i'd do it...

!?FU1;
set Flag2 to NOT
if Flag1 NOT set, do the 'does he have this skill' bit (this sets Flag2)
if Flag2, set Flag1
if Flag2, give skill

!?FU2;
set Flag1 to NOT
!!VRi: S0 R27;
!!DO1/i/27/1: P;
!!DO1/0/i&(Flag1 NOT set): P;

naturally, you'll want to replace the pseduo-code with proper script and replace the function numbers with whatever you use. also remove the spaces are the : i put those there to avoid smilies happening.

____________

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


Hired Hero
posted January 13, 2005 07:58 AM

Invincible & Drained

Thank you, volks!
I've solved that level-up problem for now.
My wrongdoing was using an y-variable where i should not have had one.
For Universities and Schools of Magic it still has to be fixed.
How to make the Invincible Last Hero is still one of my concerns.
He or she might also gandalf up a little undergoing the procedure - or get drained very badly.

Greetings to Lord British!

____________
Bring out number weight & measure in a year of dearth.

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