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 / Affecting another entity's property from a script

Author
Message
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 25th Jan 2011 10:01
Hi

I want to affect another entity's property from a script.

In this case I have a trigger zone that is placed behind an enemy (the enemy is facing in the other direction, causing him not to be able to detect the player by seeing him)

When the player steps on the trigger zone I want the enemy to turn around so that he can see the player.

Can this be done by using only the script in the trigger zone?

Best regards!
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 25th Jan 2011 10:31
Yes this can be done. Try using the "rotatetoplr" action. This action needs to be in the entity script not the trigger zone script.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 25th Jan 2011 13:15
Yes, that is the command I'm looking for.

But,,, the triggerzone script must be able to tell the entity script to face the player. Somehow this may be done,,, I'm not sure if it's even possible,,, If it is possible in an easy way, I don't know how
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 25th Jan 2011 14:29
One way I can think of is to make use of the "settargetname=" and "activatetarget=" actions and the "activated=" condition.

Set the trigger zone script within something like:

:plrwithinzone:settargetname=EnemyName,activatetarget=10

Then set the Enemy's script up with something like:

:activated=10:rotatetoplr

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 26th Jan 2011 01:53
Your enemy will NEED to be the one to rotate to the player, as the triggerzone cannot force another entity to rotate if that entity is not precoded to rotate.

Take Ched's advice and put the code in the enemy.


The one and only,


Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.
mnemonic
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 26th Jan 2011 13:14
Thanks!

I tried ched's advice and it worked as I wanted it too. Thanks again!

Login to post a reply

Server time is: 2024-11-24 13:26:10
Your offset time is: 2024-11-24 13:26:10