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 / door opens when 3 actions review

Author
Message
JoeSan
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location:
Posted: 18th Dec 2007 14:09
9 months ago I wrote a little game which included to open a door after picking up 3 objects. I copied it from someone here at this Forum and it worked great. i am now trying to use it again and it doesn't work. I've tried to search but can't find it. I wrote down at that time the "howto" and here it is:


Then place any entity that will serve as a counter, ei; a blood-spat, and use as the Main the above code and ifUsed= mydoor

Take 3 entities to be picked up (gold for instance) with Main=pickup1 and ifUsed=blood-spat

Place a door in the map call it mydoor and Main = doorremote.fpi

This is practically the same as written by the author (I wish I had written it down) but now it does not wrok at all.

Can you help?? it would be appreciated.
Jiffy
20
Years of Service
User Offline
Joined: 5th Mar 2004
Location: Hiding in the bushes in your backyard
Posted: 18th Dec 2007 15:46 Edited at: 18th Dec 2007 16:18
Well, for starters you need an = sign for the states. Also, I'm not 100% sure whether it's necessary but generally speaking your actions should have a number tied to them--sort of like 0 for no and 1 for yes. So the second line should look like:

:state=3:acticivateifused=1

I personally would have done the script a lot differently and I'm not sure how that script works exactly, but there you go.


Can't sleep? More info soon!
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 18th Dec 2007 17:14
acticivateifused=1

that has to have a number after it because it's a variable.

you could activateifused=5 and it would be different from

activateifused=2

JoeSan
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location:
Posted: 18th Dec 2007 17:23
I FOUND IT!

I had typo errors in the code snippet. Here is a copy-and paste:



Each object I pick up has in the Main any of the standard pickup.fpi but you have to add activateifused=1 like this;




Place any entity as a counter in the map editor such as spat-blood and give it as main the above counter code snippet and If Used= the-name-of-the-door-to-be-open.

The door should have as Main doorremote.fpi and as Use Key the-name-of-your-counter-entity

I find this script very useful because tou can use the same coding for 3 objects or 5 or any number simply bu changing the counter code above to that number ei; state=7 in place of state=3 for 7 objects you got to pickup.

Furthermore you can also count enemies killed and open the door only when they are all (3,5,etc) are killed.

Login to post a reply

Server time is: 2024-11-24 02:03:17
Your offset time is: 2024-11-24 02:03:17