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 / Help With Item/Door script

Author
Message
cds1234
13
Years of Service
User Offline
Joined: 30th Apr 2011
Location:
Posted: 16th Sep 2012 02:44
Hi there,
I am trying to get a script to work and could use some ideas and help.
Maybe by getting this to work it can help others use something cool as well

So, the idea is to grab an item, place it on the right location, and it triggers door open. Different from 'any'- must be specific.
I had help to design this for multiple items, but the concept applies whether it is one or more.

Thus far:
Script for getting the item:

;Triggers

state=0:state=1
:state=1,plrdistwithin=25,plrusingaction=1:setvar=bb1 1,state=2
:state=2:destroy,state=3

;End of Script

The goal-
walk up to item press enter to pick it up and it disappears.
This doesn't work- not sure why.

Next thing:
placing item on location (pickup entity, place on correct entity):

;Triggers

state=0:state=1
:state=1,plrdistwithin=25,plrusingaction=1:setvar=bb1 2,activateifused=1,state=2

;End of Script

Again, since the first script isn't working as expected, neither does this stage

Then, there is a trigger zone placed in the level.


;Triggers

:state=0:dimvar=bp,setvar=bp 0
:state=0:dimvar=bb1,setvar=bb1 0,state=1

:state=1,varequal=bb1 2:activateifused,state=2

;End of Script

The trigger zone gets ifused name of remote door which should open if item is placed on correct item.

So, any thoughts on how to set this up correctly and to make changes that could work, please help.
Thanks!
cds1234
13
Years of Service
User Offline
Joined: 30th Apr 2011
Location:
Posted: 19th Sep 2012 11:36
Please, if anyone has ideas, it shouldn't take much change to make this work. There are much more complex scripts than this- just not sure why it doesn't work.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 19th Sep 2012 12:58
you missed the first ":" in state 0, and 25 is a very short distance, better use 40.

:state=0:state=1
:state=1,plrdistwithin=40,plrusingaction=1:setvar=bb1 1,state=2
:state=2:destroy,state=3

if your triggerzone doesnt work, maybe it helps to add an active :state=2:state=3 , or build the dimvar into the doorscript and set it to always active.

cds1234
13
Years of Service
User Offline
Joined: 30th Apr 2011
Location:
Posted: 19th Sep 2012 13:31
Thanks so much Maho, you are always very helpful!
I will have to look at the script and see if I left the colon out there or not. I tried with state=3 also, but I don't understand the way dimvar would work in the door.
The way I understand it is to have a pickup script in main for the item (it should disappear after pickup), a place script for putting the item in the right entity location, and a trigger zone main that decides the # of items has been picked up. Then the door is just remote and mentioned in the ifused of the trigger zone.

I had it written for me for a specific purpose and haven't gotten it to work yet.
I'll look at the colon and get back. Thanks!
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 19th Sep 2012 15:40
i dont know how the doorscript works if its simply the activation of the entity to open, you have to look for that. if it is so, you can delete the variable and simply add "activateifused" to your pickup-script, right.

cds1234
13
Years of Service
User Offline
Joined: 30th Apr 2011
Location:
Posted: 22nd Sep 2012 02:05
Hi Maho, Thanks so much for your thoughts on this.

The first part of your suggestion did help!
I didn't see that it was missing the ":" at front of first line.

So, pickup object and adding "bb1" as first varliable seems to work now.

So, now it is stuck at the second stage that should work.

Essentially, there is script 1- pickup object.
That now works.
Stage 2 is script 2- place object, which should technically work the same way- when you reach proximity to the right object you should be able to choose "enter" and it (place) the object that was picked up in script 1.
When these variables equal what is in the trigger zone variables script, the 'ifused' of the variable script should occur. In this case, the trigger zone with ifused door, should open remote door named door.

I don't see any result happening once the item is picked up.

For the trigger zone script, I don't understand the ":state=0:dimvar=bp,setvar=bp 0" part.

I don't know what this should be assigned to, or if it is not correct.

Again, any thoughts much appreciated.
The result could be a very useful script for people!
cds1234
13
Years of Service
User Offline
Joined: 30th Apr 2011
Location:
Posted: 3rd Oct 2012 02:02
Any thoughts?
Anyone?
D0MINIK
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 3rd Oct 2012 18:00 Edited at: 3rd Oct 2012 18:13


Pickup Item
- Name your Item Key
- Assign pickupitemA.fpi (stock) as main script
- Set to be always active

Trigger Zone
- Assign the item named Key as Use Key parameter
- Assign Door1 as If Used parameter
- Assign the following main script



'Fake' Placed Item
- Create of copy of your Key item and place inside the Trigger Zone
- Set to spawn only when activated, not from start
- Rename this item to Door1
- Assign default.fpi (stock) as main script

Door
- Name your door Door1
- Assign doorremote.fpi (stock) as main script


And that's already it. No variables used, no complicated stuff. The door and your fake item are both triggerd by your trigger zone scince they share the same name. The pickup item is simply set to act as a key which is required to trigger your zone to place the fake item and open the door.

cds1234
13
Years of Service
User Offline
Joined: 30th Apr 2011
Location:
Posted: 10th Oct 2012 02:38
Hi Dom,
Thank you so much for taking the time to post this.
I will try asap.
cds1234
13
Years of Service
User Offline
Joined: 30th Apr 2011
Location:
Posted: 12th Oct 2012 22:06
Dom's method works, but not for the effect I'm hoping for.
Maybe there is an example of the 'place any object' to trigger ifused, and instead of place any object, making it the correct object like correct key.

Login to post a reply

Server time is: 2024-11-23 20:01:24
Your offset time is: 2024-11-23 20:01:24