I wanted to try some things in scripting and I have a small problem :
I have made a switch to operate a door and I want this switch to get back to "released" state after a delay while in "pressed" state you can't activate it.
It works nearly as I want but sometimes the switch is reactivated nearly immediately (the door open a bit and close afterwards - and vice versa).
Any help is welcome,
Bye,
DotK3D
here the code :
// Custom switches
define NEWSWITCH 3585
action NEWSWITCHRELEASE 0 1 1 1 1
action NEWSWITCHPRESS 1 1 1 1 1
eventloadactor NEWSWITCH
gamevar activatorLotag 0 2
getactor[THISACTOR].lotag activatorLotag
enda
useractor notenemy NEWSWITCH 0 NEWSWITCHRELEASE
ifp pfacing
ifpdistl 1280
ifhitspace
ifaction NEWSWITCHRELEASE
{
action NEWSWITCHPRESS
soundonce SWITCH_ON
operateactivators activatorLotag 0
break
}
ifaction NEWSWITCHPRESS
ifcount 64
{
action NEWSWITCHRELEASE
resetcount
break
}
endaand the test map with art file and game.con
Attached File(s)
-
testswitch.zip (23.42K)
Number of downloads: 715

Help
Duke4.net
DNF #1
Duke 3D #1



