Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Associate one entity to another

Author
Message
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 28th Oct 2011 19:48
Hi guys,

Just a question.

Is possible to associate an entity to another, so if one moves, other moves also (one is pushing another).

I know you can associate an entity to the player (associateplayer), but my question is to associate one entity to another.

Thanks,

007

Goldenye 007 N64
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 31st Oct 2011 13:59
Technically this could be done, but not using a similar command to "associateplayer" and it will require some scripting effort.

Your best best is getting the entities to react the same to their activation level. The activation level is a parameter each entity has during the game. By default the activation level is zero, but it can be changed during the game so that the entity can react to it. For example, the remove doors use the activation level to open and close when a switch is pressed - check that script out to see what it's doing.

Anyway, getting back to your associated entities. What you'll need to do is set up the script of both entities so that react according to the activation level, something like this:
Quote: ":activated=101:movefore=1
:activated=102:rotateiy=2
:activated=103:rotateiy=-2
:and so on...."


Then you need to set both entities to the same activation level during the gamne. This can be done a number of ways:

...by setting them as mutual targets:
Quote: "In Char02's script
:always:settargetname=Char01:activatetarget=101

In Char01's script
:always:settargetname=Char02:activatetarget=101"


...by setting them as each others "If Used" entity (i.e. in the editor type the name of the 'other' character in the character's "if Used" field):
Quote: "In both character's scripts
:always:activateifused=101"


...by using a useful proximity condition (entities must be named in each others "If Used" parameter):
Quote: "In both character's scripts
:always:activateifusednear=101"


The second method is probably the easiest as it only requires 1 script.

The thrid method will only work if the entities are within 80 units of each other.

I hope this helps.

Ched

007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 31st Oct 2011 23:08
Dear bro Ched,

Thanks man, you are really helping me a lot, you answered so many questions i made.

Yes i will try what you said and then i repply and post my results.

Best Regards,

007

Goldenye 007 N64

Login to post a reply

Server time is: 2024-11-24 04:31:35
Your offset time is: 2024-11-24 04:31:35