main() { brainTrigs = GetEntArray( "secret_trigger","targetname" ); level.zombie_brain_num = brainTrigs.size; array_thread( brainTrigs,::secret_item ); } //Secret_zombie_brains secret_item() { //put the script_sound kvp on the trigger assert( IsDefined( self.script_sound ) );
self PlayLoopSound( self.script_sound ); /* delete the targetname of the brain, and make each brain the target of the trigger by selecting the trig, then the brain, then pressing w */ brain = getEnt(self.target,"targetname"); self SetCursorHint( "HINT_NOICON" ); self setHintString("DOOR LOCKED"); self waittill("trigger"); self setHintString("DOOR_UNLOCKED"); self delete();
iPrintLnBold("You have found a serect zombie brain");
wait 1; iPrintLnBold("Well Done, You have opened the Secret Door"); wait 3; door1 delete(); }
You'll notice there is only one function for your secret items now. You will need to make radiant changes for this to work, such as giving all the triggers the same targetname kvp of secret_trigger and deleting the targetname of each brain, and then selecting first the trigger and then the brain, and then pressing W. Resulting in a auto numbered link between them as target and targetname. You would add the script_sound kvps to your trigger also.
Once that is done and compiled this method will work better. As far as the fx, you are simply trying to play it after there is no record of the origin, cause the object was deleted in previous steps, or self is level?
Last Edit: June 14, 2016, 09:05:53 pm by MakeCents
main() { brainTrigs = GetEntArray( "secret_trigger","targetname" ); level.zombie_brain_num = brainTrigs.size; array_thread( brainTrigs,::secret_item ); } //Secret_zombie_brains secret_item() { //put the script_sound kvp on the trigger assert( IsDefined( self.script_sound ) );
self PlayLoopSound( self.script_sound ); /* delete the targetname of the brain, and make each brain the target of the trigger by selecting the trig, then the brain, then pressing w */ brain = getEnt(self.target,"targetname"); self SetCursorHint( "HINT_NOICON" ); self setHintString("DOOR LOCKED"); self waittill("trigger"); self setHintString("DOOR_UNLOCKED"); self delete();
iPrintLnBold("You have found a serect zombie brain");
wait 1; iPrintLnBold("Well Done, You have opened the Secret Door"); wait 3; door1 delete(); }
You'll notice there is only one function for your secret items now. You will need to make radiant changes for this to work, such as giving all the triggers the same targetname kvp of secret_trigger and deleting the targetname of each brain, and then selecting first the trigger and then the brain, and then pressing W. Resulting in a auto numbered link between them as target and targetname. You would add the script_sound kvps to your trigger also.
Once that is done and compiled this method will work better. As far as the fx, you are simply trying to play it after there is no record of the origin, cause the object was deleted in previous steps, or self is level?