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 / kill enemy to open door?

Author
Message
White Mail Revived
17
Years of Service
User Offline
Joined: 12th Feb 2005
Location:
Posted: 19th Jun 2005 05:41
How do you get a door to open when you kill a certain enemy?

1% done... [href]www.x-streamsystems.tk[/href]
BULLSHOCK 2
Retired Moderator
17
Years of Service
User Offline
Joined: 14th Jun 2005
Location: Shocking Bulls
Posted: 19th Jun 2005 06:55
ask the master

http://merranvo.proboards42.com/index.cgi

I am really BULLSHOCK, but my profile got deleted...really, i'm telling the truth!
Cretinous
17
Years of Service
User Offline
Joined: 10th Mar 2005
Location:
Posted: 19th Jun 2005 07:26


There is a extremely simple code

BULLSHOCK 2
Retired Moderator
17
Years of Service
User Offline
Joined: 14th Jun 2005
Location: Shocking Bulls
Posted: 19th Jun 2005 15:08
your lucky you didnt have to ask the master(Merranvo)...he came to you...

I am really BULLSHOCK, but my profile got deleted...really, i'm telling the truth!
Mad Scientist
17
Years of Service
User Offline
Joined: 30th May 2005
Location: Fort Lauderdale, FL
Posted: 20th Jun 2005 07:39
I see how the door is being manipulated. However, I don't understand how the doors activated=1 is ever being set. How exactly does this work?

Thanks

- Jody

Relax or I'll hit you with the whip again.
ctm
17
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 20th Jun 2005 17:40
Little addition:

activateifused is the global command (for entities in the IFUSED field (here: the door)).
activate sets the "activated" value local.

The line in the Enemy Ai script:
:healthless=1:activateifused=1

"activate" can be used to reset the "activated" value.

If you want that the door opens after killing 2 enemies you can count the "activations" with the state variable:

;-if plr kills one enemy-->then set state to 1 and reset activated-
:state=0,activated=1:state=1,activate=0

;-if plr kills one more enemy-->then open the door-
:state=1,activated=1:state=2,setframe=0

:state=2:incframe=0
:state=2,frameatend=0:coloff,activate=0,state=3
Mad Scientist
17
Years of Service
User Offline
Joined: 30th May 2005
Location: Fort Lauderdale, FL
Posted: 21st Jun 2005 11:02
@ctm

Your code for the enemy looks like the character has an IFUSED property. Can you set this in the designer and I've just been missing it or can you set an entities IFUSED in the script.

- Jody

Relax or I'll hit you with the whip again.
ctm
17
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 21st Jun 2005 17:49 Edited at: 21st Jun 2005 18:06
Sorry, i have forgotten that there is no IFUSED field for characters.

I found only one way to open a door by killing a enemy.
You have to use the enemy like a key.

Use this as Destroy script for the enemy:
desc = Pickup Enemy

;Triggers

:state=0:suspend,state=1,playertake,coloff,plrsound=audiobank\misc\ping.wav

;End of Script

The player gets the key (enemy) immediately when the enemy dies...doesnt matter if the enemy is close to the player or not.

Give the enemy a new name like myAI and type the name (myAI) in the USE KEY field of the door.

Use this as Main script for the door:
desc = Key ( dead Enemy ) opens Door

;Triggers

:state=0,plrhaskey=1:state=1,setframe=0,sound=$0
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff

;End of Script

The door will open automatic after killing the enemy.
ctm
17
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 22nd Jun 2005 20:27
I tried this and it worked too (door opens immediately when enemy dies).
I never used playerdrop before. Should i see the dropped enemy?

I think best would be if Lee adds a IF USED field for characters because it would make enemy interaction possible.

About keys:
Every key has the name "key" and in every USE KEY field of the key doors is the name "key". For that reason a key opens all key doors.

If you want a key only to open one spezial door you just have to change the name in the General properties field of the key and type this name in the USE KEY field of the door (instead of key).
ctm
17
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 25th Jun 2005 02:14
Yes, it's often not easy to select a key that is placed in a level. But if it is not placed under a table or a other bigger entity it is not impossible

Login to post a reply

Server time is: 2022-12-07 00:55:10
Your offset time is: 2022-12-07 00:55:10