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 / Trigger a door when a SPECIFIC object is placed

Author
Message
Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 16th Oct 2012 17:52 Edited at: 16th Oct 2012 17:53
Can anyone assist me in editing conjured entertainments script so that only a specific item will open a door rather than any old item.

The script opens a door in the pedestals ifused field if an item is placed on it. (I am using a transparant decal) I know of "anywithinzone" and "playerwithinzone", but i think i may need to both edit this script and make a script for the specific item i would like to use. Please help!



I plan on having many of these "pressure plates" but the problem is they can all be opened by any item which is causing me grief.



Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 16th Oct 2012 18:17
this is a little bit tricky, but try this(i did not test it):
entity which should open door

(you must paste this in the entity script)example(default script):


and then for the door:


Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 16th Oct 2012 18:48
Thanks for the reply, whilst that would help me if i had one pad in one room, i dont think it would work for a setup like this, which i will need quite often, as both blue and green crates would share the same script:





cds1234
13
Years of Service
User Offline
Joined: 30th Apr 2011
Location:
Posted: 17th Oct 2012 03:52
Hi there,
I've been working on something a little similar trying to get help to make it work. If anything helps you in this thread let me know:
http://forum.thegamecreators.com/?m=forum_view&t=200184&b=23

My need was for several objects in specific places to open door-
example- 5 books on 5 tables- correct choices. But, right now happy to understand just a single correct choice correct location, and for yours it also need to be accurate if the wrong choice is made. It is possible treating the placed item as 'key' of the right kind mentioned on my link page may help?
(uses key and ifused)
D0MINIK
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 17th Oct 2012 13:18 Edited at: 17th Oct 2012 13:19
I might be wrong,

but as far as I know Trigger Zones cannot check the presence of other objects but keys the player is carrying. There is an an "anywithin" condition which won't do the job, though.

You could try an unsatisfactory work-around by animating the crates and when the player uses the crate or presses a key, the crate is pushed on a decal and triggers the door to open.

But you cannot check whether any other object but the player is within a Trigger Zone (someone correct me if I'm wrong, but I'm pretty sure of this).

Toffeemouse
14
Years of Service
User Offline
Joined: 29th Apr 2010
Location: United Kingdom
Posted: 17th Oct 2012 13:28
I have been looking for a script i found a very long time ago, it was a "physical key script", you would pick up a key entity by right clicking and carry the key to the door - when you bump it into the door the door would unlock.

I think it may have the answers because the script used for the key must be similar to the one i need as i know for certain you could not just pick up any object and push it into the door to open it.

Conjureds script was the next best thing on the FPSC guide PDF.

Having a little trouble finding this key script using the search feature, if it even exists here at all.



maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 18th Oct 2012 17:03 Edited at: 18th Oct 2012 17:04
easy to do with dimvars. dimvar=x,setvar=x 0 > pick up object triggers variable-change (addvar=x 1) > and when "using" the virtual picked up object in a triggerzone, triggerscript checks for varequal=x 1 and triggers the door if true.

not that hard to get it working.

edit: whooops, as corno did. sorry for that.^^

bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 18th Oct 2012 18:31 Edited at: 18th Oct 2012 18:31
You could use the settargetname and reachtarget commands.

For example, give the pad a name like pad 1. Then in the cube's main ai script set the target's name to pad 1. Then use the reachtarget command to detect when the cube is placed on the pad.

Something like this for the cube's main ai;



I use something very similar to this myself for detecting when the player places one entity on top of another.

Login to post a reply

Server time is: 2024-11-23 19:35:06
Your offset time is: 2024-11-23 19:35:06