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 Product Chat / Shooting Switches?

Author
Message
Corky
User Banned
Posted: 27th Nov 2007 03:41
I want to know if it is possible to instead of go up and press enter, you could just shoot it. you know if there was a switch on the other side of a mountain you could shoot it and it would open the door on your side or something like that. I have tried to look it up but I cannot find it.

Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 27th Nov 2007 03:57
Yeah, it's possible.

Check if there's shot damage, then if there is, activateifused. Then move to another state with no function, so you can't shoot the switch again and make the door close.

Corky
User Banned
Posted: 27th Nov 2007 04:10
Never scripted before in my life, so chances are its way wrong

here it is:



Corky
User Banned
Posted: 27th Nov 2007 11:20 Edited at: 27th Nov 2007 11:21
The one above doesnt work. Does anybody know?

jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 29th Nov 2007 19:44 Edited at: 29th Nov 2007 19:46
;Artificial Intelligence Script

;Header

desc = Switch Activate (toggle on and off)

;Triggers

:state=0 : shotdamage=1:state=1 : hudreset,hudx=50,hudy=90,hudimagefine=gamecoretextpressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=25:hudshow=useswitchprompt,hudfadeout=useswitchprompt

:state=10,plrdistwithin=25,plrusingaction=1:state=1,plrsound=$0,activateifused=1,alttexture=1
:state=1,plrusingaction=0:state=2
:state=2,plrdistwithin=25,plrusingaction=1:state=3,plrsound=$1,activateifused=0,alttexture=0
:state=3,plrusingaction=0:state=10

;End of Script

I am not a scripting wizard by any means, but i would look at what I bolded. The : I bolded, I think may have to be a , instead.

And it looks like you are saying the player has to be within 25 units from the switch; which may not be the case if you are shooting it from across the room.

Some of the real scripters may be able to better help you.

John[u]
Corky
User Banned
Posted: 30th Nov 2007 09:34
so maybe its like this



jcleaver
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 30th Nov 2007 17:59
Try this one, I think you still had too many : on the line. I think you can only have 2 :'s per line. The first to show a condition, and the second to initiate an action. I haven't written many scripts, so I could be wrong in this. Hopefully someone will correct me if I am wrong.



It seems that if the player does get to within 25 units, a message will be displayed to press enter to activate switch. That may or may not be what you intend.

Also, something just does not look right to me. In the first line, you set state=1, then later in same line you set state=10, which negates your first assignment.

I might have to play with this and see if i get it to work. I've always liked a challenge, even simple ones like this! (At least i think this will prove to be simple).
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 30th Nov 2007 19:15
Quote: ";Artificial Intelligence Script

;Header

desc = Switch Activate (toggle on and off)

;Triggers

:state=0 , shotdamage=1:state=1 , hudreset,hudx=50,hudy=90,hudimagefine=gamecoretextpressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10

:plrdistwithin=25:hudshow=useswitchprompt,hudfadeout=useswitchprompt

:state=10,plrusingaction=1:state=1,plrsound=$0,activateifused=1,alttexture=1
:state=1,plrusingaction=0:state=2
:state=2,plrusingaction=1:state=3,plrsound=$1,activateifused=0,alttexture=0
:state=3,plrusingaction=0:state=10

;End of Script"


this might be the prob, your telling it that it needs you to press action key,(normally enter).

I'm referring to the bold,kk?

Corky
User Banned
Posted: 30th Nov 2007 20:47
Thanks I will try them in a few minutes

Login to post a reply

Server time is: 2024-10-10 07:31:42
Your offset time is: 2024-10-10 07:31:42