Help : Script to disable Magic Springs and Wells

Official forum of the Wake of Gods mod to Heroes of Might and Magic III.
User avatar
Farilis
Leprechaun
Leprechaun
Posts: 8
Joined: 19 Jan 2006

Help : Script to disable Magic Springs and Wells

Unread postby Farilis » 19 Jan 2006, 04:41

I'm getting extreme headaches trying to create a script to disable Magic Springs and Magic Wells from appearing in Random Maps. Can anyone help me?

I tried

!?OB48;
!!OB48:S;

and

!?OB49;
!!OB49:S;

but it doesn't work.

Could someone post proper commands to prevent Players and Computers from using Magic Wells and Magic Springs or to completely prevent these map objects from appearing upon creation of random maps?

Thanks in advance.

User avatar
Fnord
Round Table Knight
Round Table Knight
Posts: 341
Joined: 27 Nov 2005
Location: Victoria, BC, Canada

Re: Help : Script to disable Magic Springs and Wells

Unread postby Fnord » 19 Jan 2006, 09:31

Farilis wrote:I'm getting extreme headaches trying to create a script to disable Magic Springs and Magic Wells from appearing in Random Maps. Can anyone help me?

I tried

!?OB48;
!!OB48:S;

and

!?OB49;
!!OB49:S;

but it doesn't work.

Could someone post proper commands to prevent Players and Computers from using Magic Wells and Magic Springs or to completely prevent these map objects from appearing upon creation of random maps?

Thanks in advance.
While you can use the object type as a trigger, you have to use specific coordinates for the receiver. However, all objects will have their coordinates stored in v998/v999/v1000 when a hero visits them, so you can do the following:

Code: Select all

!?OB49;
!!OBv998/v999/v1000:S;
You can also abbreviate this to:

Code: Select all

!?OB49;
!!OB998:S;
By leaving out the "v" it assumes you mean the v variable for the number given and the next two that follow. e.g., when you put !!OB49:S; it assumed you mean an object at the coordinates stored in v49/v50/v51 (equivalent to !!OBv49/v50/v51;).

Unfortunately, this disabling will NOT give the desired results for the AI. The AI hero won't be able to use the Magic Well but it won't understand this and will go there anyway. When it reaches the Well it won't get its mana restored. Next turn it will try again. And again. And again.

You can get around this by changing the Magic Well square from a yellow trigger square to a non-yellow, red "impassable" square with the TR command.

Try the following:

Code: Select all

!?OB49;
!!OB998:S; [Disable object]
!!TR998:E1 P0; [Change yellow trigger to red impassible]
Your other idea, to remove all Magic Wells from the map, is also possible but would require a DO loop and the UN:U command.

Something like this might work...

Code: Select all

!?PI;
!!UN:U49/-1/?y-1; [Get number of Magic Wells on map]
!!VRv1:S-1; [Initialize v1 to -1 for fast UN:U looping]
!!DO29600/1/y-1/1; [Loop through all Magic Wells on map]

!?FU29600;
!!UN:U49/-1/-1/1; [Get coordinates of next Magic Well into v1/v2/v3]
!!UN:Ov1/v2/v3; [Delete Magic Well]
I haven't tested it...it's late, so hopefully it will work.
- Fnord

User avatar
Farilis
Leprechaun
Leprechaun
Posts: 8
Joined: 19 Jan 2006

Unread postby Farilis » 19 Jan 2006, 10:03

Oh, I see. Thanks a lot for the for the codes, Fnord.
I'm going to test them now.

---------------

'Kay... I tested them.

This code gave me errors.
!?PI;
!!UN:U49/-1/?y-1; [Get number of Magic Wells on map]
!!VRv1:S-1; [Initialize v1 to -1 for fast UN:U looping]
!!DO29600/1/y-1/1; [Loop through all Magic Wells on map]

!?FU29600;
!!UN:U49/-1/-1/1; [Get coordinates of next Magic Well into v1/v2/v3]
!!UN:Ov1/v2/v3; [Delete Magic Well]

-------------------------

This one below works wonderfully, tee hee. So, I think this is the one I'm going to use. Thanks again for the help. Finally, my headache's gone.
!?OB49;
!!OB998:S; [Disable object]
!!TR998:E1 P0; [Change yellow trigger to red impassible]

User avatar
Siegfried
Pixie
Pixie
Posts: 124
Joined: 13 Jan 2006
Contact:

disable object appearance

Unread postby Siegfried » 19 Jan 2006, 10:51

Hi,

so basically there is no chance to disable certain objects from appearing in random maps. With erm you only have the chance to remove them after map creation and before first day. Is this correct?

I think i saw a text file related to random map creation in the h3bitmap.lod, but it may also instead be related to the "brush" in the map editor, i don't know. If this file is related to random map creation then it may be possible to really prevent these objects from beeing generated at all.

As far as i do recall, the random map generator template file Rmg.txt does not allow to exclude certain objects from appearing. Only resource piles, chests, dwellings and towns.


Return to “Wake of Gods”

Who is online

Users browsing this forum: No registered users and 2 guests