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 / Scripting questions. Any help appreciated.

Author
Message
jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 23rd Feb 2005 21:43
I have a question concerning how to script an action for a particular entity by using a switch. In general, this would free up a lot of possibilities. I remember reading that Lee said that with scripting, just about anything was possible. I have looked for examples of what I want; and can't find any. Maybe I'm just too dense. I have read the manual, re-read the manual, and can not find a suitable solution.

In specific, how does one cause a script for a character entity to run from another entities script? What I want to do is throw a switch, and have a particular enemy die.

Can you refernce a specific entity in a script?
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 23rd Feb 2005 22:01
Put the enemy entity name in the IFUSED: field of the switches properties. Then check the switch MAIN script, and make sure it says activateifused=1

Then in the enemy's MAIN script you can use the activated=1 condition to trigger what you want the entity to do.

You can use any number in the activateifused action just make sure the number is the same as the activated condition, e.g

Switch:
activateifused=99 action

Enemy
activated=99 condition

If you want to make this work with more than 1 enemy, make sure all the enemys have the same name.

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 23rd Feb 2005 22:33
THANKS! I'll try this out. This has been my last hang-up with a level I'm trying. (That and my unartistic mind!)
jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 23rd Feb 2005 23:34
OK, I tried it; but I can't get it to work. I made sure that the properties of the switch named the specific enemy (COLX, the name I gave it. In the main script for COLX, I inserted this line at the top below the word 'Triggers':

:activated=1: suspend, coloff

However, after pressing switch COLX continues to be a living concern.

I did not change the switch script as the activateifused=1 is already there.
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 23rd Feb 2005 23:49
With these sorts of things, always hide a unique sound effect in the audiobank directory. If something doest seem to work then I comment out the line and duplcate the condition but make the action to play the sound so:

;:activated=1:suspend,coloff
:activated=1:sound=audiobank\mysound.wav

That way you can make sure the entity is recieving the activated signal.

Could you check to make sure it's getting the activated signal?

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 24th Feb 2005 02:08
Thanks again. I did that, and I see that the enemy is not getting activated. Is this a bug? I have made sure that the name is the same in the ifused section of the properties as it is named in the name field of the properties of the enemy.

I am assuming you have gotten this to work. Is there a distance requirement between the switch and the enemy? I have created a small 1 room level for testing, and I still can not get it to work.
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 24th Feb 2005 08:23
I've beening playing with this a lot tonight and still need to look into it . (Having a problem with the suspend command, probably using it wrong)

One way i have found that will kill the enemy, is to change the Destroy AI script in the properties to destroy\fadecorpse.fpi if it isn't already

And in your script use:

:activated=1:runfpidefault=2

This has the effect of when it is activated it will fade and destroy it'self.



I've attached the test level to this post save the above script into scriptbank\user\coward.fpi

This shows what I'm on about.

http://www.tyranntrpg.org/support/switch_kill.wmv

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"

Attachments

Login to view attachments
jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 24th Feb 2005 10:17
Again, many thanks. This appears to work. I am going to keep trying things, as I would prefer to leavecorpse, but this will get me going! Again, many thanks!
jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 24th Feb 2005 11:00
Well, I spoke a little early. If I use your coward.fpi script, it works. I wanted to use the static.fpi script for agressive sentry, so I used the

:activated=1:runfpidefault=2

line at the first line of Triggers like you did for the coward.fpi script and it doesn't work. I'll have to study this further.
jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 24th Feb 2005 22:20
OK, FWIW, I found my problem. It turns out that the chase.fpi script is run when the enemy aquires the target. So I copied the chase.fpi script to the user dir and added the activated line to it also and now it works as it should; with the strange result of the gun floating in midair after the entity disappears. (It doesn't shoot by itself though) This is a minor thing which can be fixed. Woo Hoo!

Login to post a reply

Server time is: 2024-11-23 08:12:49
Your offset time is: 2024-11-23 08:12:49