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 / I`m stuck. And it should be easy...

Author
Message
Ertlov
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Austria
Posted: 27th Jun 2012 21:46 Edited at: 27th Jun 2012 22:34
Hi all, I need a script for an item displaying an HUD that only appears when four different other items have been collected (but those in random order) zhe items ould be taken with the plrtake command.

I was thinking about something like

state=5,plrhas=card1,plrhas=card2,plrhas=card3,plrhas=card4:state=10

state=10:run my fancy action

But there is no plrhas=, nor a plritem=, nor a plrhasitem=, right?

EDIT: Don`t get me wrong, I know how to do that with global variables, I just believe there must be an easier way...

Come to where the madness is:http://www.homegrowngames.at
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 27th Jun 2012 22:44 Edited at: 27th Jun 2012 22:46
There is no "plrhas" command, except if I recall the "plrhaskey" is about as close as you get to that.

The easiest way is by using "dimvar" and "varequal=x y", where x is the variable name you used in the "dimvar" command and y is the value. By using your example, you can use "dimvar=card1", "dimvar=card2", etc. You can script to check the values of each variable like this:

:state=10,varequal=card1 0:go here and do this
:state=10,varequal=card1 1:go here and do this

That is about the easiest it gets.


Twitter: @NFoxMedia
Ertlov
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Austria
Posted: 27th Jun 2012 23:38
Already done that

I just thought there is a way without global vars.

Come to where the madness is:http://www.homegrowngames.at
Teabone
Valued Member
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Canada
Posted: 28th Jun 2012 04:10
I think if you use them as objectives.

maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 29th Jun 2012 20:41 Edited at: 29th Jun 2012 20:42

Login to post a reply

Server time is: 2024-11-24 01:04:01
Your offset time is: 2024-11-24 01:04:01