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 / Remote door trigger script help

Author
Message
Taterx11
15
Years of Service
User Offline
Joined: 27th Dec 2008
Location:
Posted: 24th Feb 2009 22:39 Edited at: 25th Feb 2009 01:10
alright, the goal of this script is to make it so when i place a book named 'hb' on a table, a nearby remote door will open. (This is an edit of a script inside the fps guide)
Heres my work so far:

[/code] ;Artificial Intelligence Script
;Header
desc = open up
;Triggers
:state=0,entitywithinzone=hb:activateifused=1,state=1
:state=1,entitywithinzone=0:activateifused=0,state=0
;End of Script [code]

So I was wondering if anyone know where the issue is, i know that I have all the other things set up correct as in I have the 'ifused' and 'remotedoor' etc.

(in line state=0 'hb' is the name of the entity)

Bob Dole sent me, he wants coffee.
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 25th Feb 2009 00:35
I think entitywithinzone takes a Boolean only - true or false - 0 or 1.

Best.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 25th Feb 2009 00:52
Unfortunately, the command you're trying to use "entitywithinzone" is not programmed. It won't work... it's pretty much nonexistent.

However, there is another command you can use to get the results you're looking for: "anykeywithinzone"

This command will be TRUE if the zone's "UseKey" is in the zone and false if the key is not in the zone.


You may have already guessed, but triggerzones do not HAVE a "UseKey" property, which is a bit problematic. To get this to work, you'll need to make a NEW triggerzone entity, open its FPE file and add the line:

UseKey = NameOfKeyEntity


Obviously, you'll put the name of the entity that the zone should use as it's key. Make sure the name in the file is exactly the name you give the key entity.


Hope this helped.


The one and only,


Taterx11
15
Years of Service
User Offline
Joined: 27th Dec 2008
Location:
Posted: 25th Feb 2009 00:54 Edited at: 25th Feb 2009 01:20
-Removed- (question answered)

Edit: So I am to copy the triggerzone and make a different version of it by adding the line to the .fpe file?

Edit again: I Added the line and I figured that I should put the name of the door in the 'ifused' box. Thanks

Edit a third time: Errr, well I put the correct name in the ifused box but I notice that the 'hb' entity does not activate anything and the zone makes the normal 'zoneactivated' ($0) sound when i walk through it. What script should I use for this zone to allow the usekey to be the trigger?

Bob Dole sent me, he wants coffee.
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 25th Feb 2009 01:50 Edited at: 25th Feb 2009 04:44
I have done this exact thing before using anywithinzone. It was a controlled environment and only one item was available to be placed in the zone, so it worked for me. It may not be suitable for you. This is the simple code I used.

:state=0,anywithinzone=1:activateifused=1,sound=$0,state=1

Best.

Taterx11
15
Years of Service
User Offline
Joined: 27th Dec 2008
Location:
Posted: 25th Feb 2009 15:38
I have an idea. Ill make all other entitys static so the player can only move the entity that i want to be used to open the door.

Thanks for the help

Bob Dole sent me, he wants coffee.
X10 User
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location:
Posted: 26th Feb 2009 03:07
theres a script in the script bank'zoneanyactivate.fpi' give that to the aimain of the trigger zone, in the trigger zone enter the doors name in the ifused field, then whenever you place a dynamic entity withn the trigger zone the door will open, take the entity out and the door will close

Code can be confusing when your new (Im a newbie too) but this one can be achieved without editing any fpi's or fpe's

hope that helped

but yeah your right just have the one dynamic entity nearby as any dynamic entity within the trigger zone will open the door whereas you just want it to be your book

- Why is everyone on here so rude? -
Halfpastundead
15
Years of Service
User Offline
Joined: 7th Mar 2009
Location:
Posted: 31st Mar 2009 06:09
X10 user - I am trying to do something similar and I did everything as far as the trigger zone. What does my object(key) need to be set as? I gave it the pickup1 script so that the player can pick it up, but when I take it over to the trigger area I get a press enter to open and when I hit enter, I hear a door opening, but my remote door doesn't open. Is there something I am missing?

Login to post a reply

Server time is: 2024-11-24 23:06:51
Your offset time is: 2024-11-24 23:06:51