Hello again So I was wondering is there a way to play a fx with a trigger_damage but with a specific weapon? I'm pretty sure it requires scripting and I quite suck at scripting I know there's a tut how to open a door with a specific weapon is that something similar?
Hello again So I was wondering is there a way to play a fx with a trigger_damage but with a specific weapon? I'm pretty sure it requires scripting and I quite suck at scripting I know there's a tut how to open a door with a specific weapon is that something similar?
just to make sure your wanting to play an fx in the world when a player damages something with a specific weapon?
this edited version the tutorial script will play an fx on the trigger once its been activated
Code Snippet
Plaintext
ShootTrigger(){ shoot = getentarray("shoot_door", "targetname"); requiredWeapon = "none"; //change to weapon specific name for(trig=0;trig<shoot.size;trig++){ door = getentarray(shoot[trig].target, "targetname"); for(d=0;d<door.size;d++){ door[d] thread TrigAction(shoot[trig],requiredWeapon,"door"); //change for other action } shoot[trig] thread TrigAction(shoot[trig],requiredWeapon,"sound"); //change for other action shoot[trig] thread TrigAction(shoot[trig], requiredWeapon,"fx"); } } TrigAction(trig,requiredWeapon,action){ while(1){ trig waittill("trigger", player); weapon = player getcurrentweapon(); if(requiredWeapon == "none" || weapon==requiredWeapon){ break; } wait(.1); } if(action=="door"){ move = (0,0,100); if(isdefined(self.script_vector)){ //adjust in radiant or the door will just move up 100 move = self.script_vector; } speed = 1; self moveto(self.origin + move,1); self ConnectPaths(); trig delete(); wait(1); // self delete(); //if you want to delete the door after it moves }else if(action=="sound"){ play_sound_at_pos("door_slide_open", self.origin); } else if(action=="fx"){ //un-comment these lines and add your own action for something if you want playFXOnTag(level._effects["name_of_effect"],trig,"tag_origin"); } }
this is done using the method playFXOnTag() which plays an fx on a specified tag of an entity(in this case "tag_origin"). this can be used to move an fx with an entity as its being moved
if the fx you want to play isnt being used anywhere else in the level you will need to make sure you load the fx using the line
Code Snippet
Plaintext
level._effect["name_fo_effect"] = loadfx( "location_of_fx_in_you_fx_folder_in_raw" );//long string name xD
please make sure to give makecents credit for the origin script. and let me know if you need any more help
this edited version the tutorial script will play an fx on the trigger once its been activated
Code Snippet
Plaintext
ShootTrigger(){ shoot = getentarray("shoot_door", "targetname"); requiredWeapon = "none"; //change to weapon specific name for(trig=0;trig<shoot.size;trig++){ door = getentarray(shoot[trig].target, "targetname"); for(d=0;d<door.size;d++){ door[d] thread TrigAction(shoot[trig],requiredWeapon,"door"); //change for other action } shoot[trig] thread TrigAction(shoot[trig],requiredWeapon,"sound"); //change for other action shoot[trig] thread TrigAction(shoot[trig], requiredWeapon,"fx"); } } TrigAction(trig,requiredWeapon,action){ while(1){ trig waittill("trigger", player); weapon = player getcurrentweapon(); if(requiredWeapon == "none" || weapon==requiredWeapon){ break; } wait(.1); } if(action=="door"){ move = (0,0,100); if(isdefined(self.script_vector)){ //adjust in radiant or the door will just move up 100 move = self.script_vector; } speed = 1; self moveto(self.origin + move,1); self ConnectPaths(); trig delete(); wait(1); // self delete(); //if you want to delete the door after it moves }else if(action=="sound"){ play_sound_at_pos("door_slide_open", self.origin); } else if(action=="fx"){ //un-comment these lines and add your own action for something if you want playFXOnTag(level._effects["name_of_effect"],trig,"tag_origin"); } }
this is done using the method playFXOnTag() which plays an fx on a specified tag of an entity(in this case "tag_origin"). this can be used to move an fx with an entity as its being moved
if the fx you want to play isnt being used anywhere else in the level you will need to make sure you load the fx using the line
Code Snippet
Plaintext
level._effect["name_fo_effect"] = loadfx( "location_of_fx_in_you_fx_folder_in_raw" );//long string name xD
please make sure to give makecents credit for the origin script. and let me know if you need any more help
Thanks you very much I will be sure to credit you aswell