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 / Problems with usingweapon=x

Author
Message
sberk
14
Years of Service
User Offline
Joined: 6th Jun 2010
Location: next to a cup of coffee
Posted: 11th Aug 2010 16:25
Hello,

I want that different weapons have different effects on an entity. For testing purpose I'm using a box with this main script:

;Artificial Intelligence Script

;Header

desc = Different beheviour for different weapons
;Triggers

:state=0:state=1
:state=1,usingweapon=0:state=2
:state=1,usingweapon=1:state=3
:state=1,usingweapon=2:state=4
:state=1,usingweapon=3:state=5

:state=2,SHOTDAMAGE=1:fpgcrawtext="Hallo0",ADDHEALTH=25
:state=3,SHOTDAMAGE=1:fpgcrawtext="Hallo1",ADDHEALTH=25
:state=4,SHOTDAMAGE=1:fpgcrawtext="Hallo2",ADDHEALTH=25
:state=5,SHOTDAMAGE=1:fpgcrawtext="Hallo3",ADDHEALTH=25

;End of Script
[\code]

I thought that I can assign the weaponnumbers using the following code, when picking the weapons up. (Just one line changed from the original version.)


;Artificial Intelligence Script

;Header

desc = Weapon Pickup

;Triggers

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pickedupaweapon.tga,hudname=weaponprompt,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=40:state=1,gunslot=1,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,hudshow=weaponprompt,hudfadeout=weaponprompt
;state=2:state=3,playerdrop,colon,plrsound=audiobank\items\pickup.wav
:state=3,plrdistfurther=65:state=10

;End of Script
[\code]

Can anybody give me a hint, where the error is in my script?
cheers
sberK
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 11th Aug 2010 20:35
Hmm..

Well,when you use a certain type of weapon on an entity,then it will change the state to something(3 for example),but when you shoot the entity with say weapon 3 and change he state to 3,then you can't go back and shoot it with a different weapon,because then in the condition state=1 will be state 3 instead.The way it should be done is

:usingweapon=1,shotdamage=1:addhealth=-25

and so on...

sberk
14
Years of Service
User Offline
Joined: 6th Jun 2010
Location: next to a cup of coffee
Posted: 13th Aug 2010 10:10
Hi,
thanks a lot. The script is now:
[script]
;Artificial Intelligence Script

;Header

desc = Default Entity Behaviour (Nothing)

;Triggers

:state=0:state=1
:state=1,usingweapon=0,SHOTDAMAGE=1:fpgcrawtext="weapon0",ADDHEALTH=25
:state=1,usingweapon=1,SHOTDAMAGE=1:fpgcrawtext="weapon1",ADDHEALTH=25
:state=1,usingweapon=2,SHOTDAMAGE=1:fpgcrawtext="weapon2",ADDHEALTH=25
:state=1,usingweapon=3,SHOTDAMAGE=1:fpgcrawtext="weapon3",ADDHEALTH=25


;End of Script
[/script]
and everything seems to work fine.
cheers

Login to post a reply

Server time is: 2024-11-24 21:34:55
Your offset time is: 2024-11-24 21:34:55