Page 3 of 3

Posted: Mon Feb 27, 2006 6:48 pm
by Ransom
Let's assume pawn A stands still and pawn B stands 10 meters away from it. A is B's enemy and vice versa. Now... if pawn C, that is A's ally, is standing exactly between them, it prevents pawn A from "seeing" pawn B.
Well, thats one reason to use more than one TraceToActor command.

Here's how it would break down...

1. Use a naming convention for your pawns, for example, say you have two groups of pawns, Red and Blue. Name all the Reds "Red01","Red02", and so on. Use the same method for the Blues.

2. In your script you have something like...

//A Red Pawn

MYVAR1=TraceToActor(bone,x,y,z);
if(MYVAR1=false)
{
//Nothing is there, so react accordingly
}
MYVAR2=LeftCopy(MYVAR1,3);
if(MYVAR2="Red")
{
//The Pawn is a friend, so react accordingly
}
if(MYVAR2="Blu")
{
//The Pawn is an Enemy
SetTarget(StringCopy(MYVAR1));
//Do other mean stuff
}

You get the idea?

Posted: Tue Feb 28, 2006 11:49 am
by Juutis
Hmm... it's not that complicated after all. :D
Man, there's some really cool things that could be done with this. For example pawns could actually check if there's friendly pawns nearby and work as a team. :P

By the way... is there any way for a pawn to change another pawn's variables? Like EntityName.VARIABLE = 100 or something. This would enable a kind of communication between pawns.

Posted: Tue Feb 28, 2006 1:28 pm
by Ransom
is there any way for a pawn to change another pawn's variables?
In this post viewtopic.php?t=148&start=0
Pickels wrote
As of the new RF you can completely avoid the attributre system and use the new simkin features to do some SERIOUS data manipulation between pawns....


1 - At the top of your script define whatever variable you want to change. For example: HITPOINTS[10]

2 - Give the pawn an szEntityName. For example: pawn01

3 - The variable for that pawn can be accessed using the convention: pawn01.HITPOINTS and be accessible from any other script.

HP = pawn01.HITPOINTS; // get value
pawn01.HITPOINTS = 5; // set value

You can do this with strings, integers and floats.
But I haven't gotten that to work, myself. But, yeah, that would open up so many doors... If anyone knows how to make this work, I'm sure we'd all like to know how.[/quote]

Posted: Tue Feb 28, 2006 2:37 pm
by Juutis
Ok, I really got excited about this thing and now I'm planning to start building the PERFECT (enemy)pawn. :wink:

I haven't gotten that variable manipulating to work either... A shame, it would be very useful.