Jump to content

Anti - Parties


nikki.

Recommended Posts

Is there any way to construct a group of 4 characters that move identically, but oppositely, to the party - moving left instead of right. Players of Tomb Raider 1 will understand what I mean.

 

For instance, if the party moves one space NW, the other group will move SE. This would be perfect for my scenario, so please help!

Link to comment
Share on other sites

Yes, it's possible.

 

Only pseudo-code here I’m afraid, as it’s been a while since I programmed with anything as finickity & C like as AvernumScript and it’s taking me hours to get nowhere (although secretly I’m impressed, it maybe akin to conducting an auto-splenectomy with a rusted coat-hanger, but still more powerful that any other scenario editor I’ve come across).

 

Anyway here goes. As you can’t define any arrays of your own I’d suggest using 19 SDF’s. The 1st -for simplicities sake I’ll say sdf(0,0) - holds the direction that your party has travelled this turn; as follows:

 

1 2 3

4 5 6

7 8 9

 

i.e. if the party travels north set sdf(0,0) to 2 for this turn, south 8 etc.

 

The remaining 18 hold x & y offsets for the mirror move. Not sure what corner(0,0) is, assuming top left here, e.g.

 

0,0

|

|

|

------------ x,x

 

So travelling up or left is a negative value, whilst down and right are positive. However, you want the other party to travel in the opposite direction, so the values should be:

 

X

 

1 0 -1

1 0 -1

1 0 -1

 

Y

1 1 1

0 0 0

-1 -1 -1

 

If you take sdf(1,0) through (9,0) for x and sdf(1,1) through (9,1) for y.

 

sdf(1,0)=1

sdf(1,1) = 1

sdf(2,0)=0

sdf(2,1)=1

:

:

sdf(9,0) = -1

sdf(9,1)=-1

 

Then when u update the other parties location change it’s x by sdf(sdf(0,0), 0) and change the y by sdf(sdf(0,0), 1).

 

Maybe... confused

Link to comment
Share on other sites

Hmm, I have a sudden insight.

 

How about use char_loc_x() and char_loc_y() on the starting character (0), and store those as either variables or SDFs. Then check the location again later and compare the 2 values for x and y. I suggest putting this in the START_STATE of your town script to make it run every turn, and for the sake of simplicity, only use the first character for movement, even if you have to split up the party. Be sure to use a is_town() call so they don't go into combat.

 

The little table for the movements is in Eldritch_Cadillac post, of course.

 

Instead of a moving the character with relocate_character(), you could put the script in the creature's script and tell it to move to the necessary space.

 

EDIT: The call is move_to_loc_x_y() for the creature script.

Link to comment
Share on other sites

Hmmm, yes that be much easier.

 

mirrorX = (Current X - Previous X) * -1

mirrorY = (Current Y - Previous Y) * -1

 

Only got this at the weekend. Yesterday I didn't know about SDF's and was considering making identical looking terrains with differing ID's to change and reference and pass parameters!

 

Also spent all night with a script that would not provide an error, just didn't run. I'd included a then with my if statement. grrrr!

Link to comment
Share on other sites

You mean like the then flow controller in VB?

 

Could you tell us exactly what you are planning? The script must obviously adapt with the situation. Maybe combat mode won't affect it too badly. Maybe.

 

Be sure to use the is_blocked(), is_object_on_space(), and char_on_loc() calls so you don't teleport the anti-PC into a wall or another monster.

Link to comment
Share on other sites

A completely strange thought: depending on what you're doing, you may want a terrain script for this, because those are the only things that are called every time a character moves in combat. (That is, if you want the anti-party to mirror the party *instantly* even in combat mode, the ONLY way to do that is using a terrain script's START_STATE.)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...