Anti - Parties

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Anti - Parties
Shaper
Member # 3442
Profile Homepage #0
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!

--------------------
And when you want to Live
How do you start?
Where do you go?
Who do you need to know?

Posts: 2864 | Registered: Monday, September 8 2003 07:00
Apprentice
Member # 4119
Profile #1
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:

[ Wednesday, July 21, 2004 11:54: Message edited by: Eldritch_Cadillac ]
Posts: 23 | Registered: Thursday, March 18 2004 08:00
Agent
Member # 2820
Profile #2
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.

[ Wednesday, July 21, 2004 08:36: Message edited by: Keep ]

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Apprentice
Member # 4119
Profile #3
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!
Posts: 23 | Registered: Thursday, March 18 2004 08:00
Shock Trooper
Member # 4154
Profile #4
Just remember that things will go screwy if you try that in battle mode.

--------------------
You're a moron if you think I'm not.
Posts: 213 | Registered: Friday, March 26 2004 08:00
Agent
Member # 2820
Profile #5
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.

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Off With Their Heads
Member # 4045
Profile Homepage #6
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.)

[ Wednesday, July 21, 2004 10:00: Message edited by: Just call me Kel ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Shaper
Member # 3442
Profile Homepage #7
I'd like to mimic everything the party does immediatley. I don't want to say why, without giving too much plot away. I've experimented with the idea of using cutscenes, but it just looks wrong.

--------------------
And when you want to Live
How do you start?
Where do you go?
Who do you need to know?

Posts: 2864 | Registered: Monday, September 8 2003 07:00