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 / Scripting problem and no idea why (Please HELP!!!)

Author
Message
Evil Super Jesus 6
12
Years of Service
User Offline
Joined: 11th May 2012
Location: Bonny Ol Scotland
Posted: 17th May 2012 21:27
I have written this code and tried and checked but i do not know why it hasn't worked

This is it


;Artificial Intelligence Script

;Header

desc = Weapon Pickup-500$

;Triggers

:state=0,varequal=cecashcounter 500:state=5
:state=0,varless=cecashcounter 500:state=4
:state=0,vargreater=cecashcounter 500:state=5
:state=4,plrdistwithin=40:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=70,fpgcrawtext=You don't have enough money.Cost - 500$
:state=5,plrdistwithin=40:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=70,fpgcrawtext=Cost - 500$ - Press [F] to pick up weapon
:state=5,plrdistwithin=40,scancodekeypressed=33:subvar=cecashcounter 500,state=1,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,hudshow=weaponprompt,hudfadeout=weaponprompt


;End of Script




As you can see i am new to this so any help is appreciated.
Anigma
13
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 18th May 2012 01:37
I don't see anything obviously wrong. What does it not do?

It compiled! Ship it!
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 18th May 2012 04:17
You have this...

Quote: "hudshow=weaponprompt,hudfadeout=weaponprompt"


...and you have not "defined" the hud in your script. For example, look at the doorkey.fpi script and see the first lines:



See how the hud is called upon, where the "hushow=x" and "hudfadeout=x", where x=keydoorprompt? You need to define your hud so when called upon, it knows what it needs to do.


Twitter: @NFoxMedia
Evil Super Jesus 6
12
Years of Service
User Offline
Joined: 11th May 2012
Location: Bonny Ol Scotland
Posted: 18th May 2012 13:57
The problem is, it only seems to go to state 4 no matter how much money you have (It doesn't let me buy the weapon).
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 18th May 2012 17:03
Even if you got past "state=4", your hud at the end of your script will not display.

Here is what I might do:

":state=0" lines to define any hud image(s)

":state=0:state=1" to go to my next part-

":state=1:dimvar=cecashcounter,state=2" to call the variable

":state=2:" lines contain the varless/vargreater/varequal lines, which then go to the next required state if that condition is met.


Twitter: @NFoxMedia
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 18th May 2012 17:05
Try editing this
:state=4,plrdistwithin=40:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=70,fpgcrawtext=You don't have enough money.Cost - 500$


to something like this

:state=3:etimerstart
:state=4,plrdistwithin=40:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=70
:state=4:fpgcrawtext=You don't have enough money. cost-$500
:state=4,etimergreater=1000:etimerstart,state=5
:state=5,plrdistwithin=40:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=70
:state=5:fpgcrawtext=Cost-$500(press f to buy)
:state=5,etimergreater=1000

I haven't tested but It seemed to work well for me when I used three lines to display the fpgcrawtext. Your more than welcome to use this code as a model.
http://forum.thegamecreators.com/?m=forum_view&t=196813&b=23

Login to post a reply

Server time is: 2024-11-24 00:46:03
Your offset time is: 2024-11-24 00:46:03