Droidy365 Posted December 14, 2017 Share Posted December 14, 2017 Hey guys, I'm wondering how I can make corpses instantly disappear, while having a sort of explosion as they die. I want this to happen with all NPCs and Players that die. This is going to be for my Sword Art Academy mod. Unfortunately, g_corpseRemovalTime isn't quick enough, as I need it to be instant. If at all possible, I would prefer to do this without coding, because I can't code for crap, thanks Smoo likes this Link to comment
Lazarus Posted December 14, 2017 Share Posted December 14, 2017 You could remove it via script! As i correctly understood earlier here: https://jkhub.org/topic/9858-run-script-on-certain-health-or-shield-value/ is that you can make a script look for a health level ... just check if it's 0, if so, remove the npc from the game. Link to comment
Droidy365 Posted December 15, 2017 Author Share Posted December 15, 2017 Hmmm, I'm guessing that would only work on a map I specifically made for the mod? I would prefer it if it worked on any and all maps, as well as all players/NPCs, but if that's not really possible, I could try giving this a shot. How would I get it to check for all players and NPCs, and how would I make the explosion? Thanks EDIT: One more thing: How do I run a script when the map starts? I want to run sao/kill_check.ibi, which should then run sao/killed.ibi. Link to comment
Droidy365 Posted February 5, 2018 Author Share Posted February 5, 2018 I'm gonna bump this, because I still couldn't get this to work, unfortunately.If someone could do something like this with coding or scripts, please do so lol.I'll probably name the effect "effects/sao/death_sparks.efx" if that helps Link to comment
Droidy365 Posted February 7, 2018 Author Share Posted February 7, 2018 Hello? Anyone there? I'm bumping this again, because it somehow got buried underneath other posts enough to disappear from the New Content page...... EDIT: @@Noodle @@Langerd Could either of you two help? Thanks guys Link to comment
Noodle Posted February 8, 2018 Share Posted February 8, 2018 EDIT: One more thing: How do I run a script when the map starts? I want to run sao/kill_check.ibi, which should then run sao/killed.ibi. If it's a singleplayer map, make sure the player triggers a target_scriptrunner when he starts the map. Hey guys, I'm wondering how I can make corpses instantly disappear, while having a sort of explosion as they die. I want this to happen with all NPCs and Players that die. This is going to be for my Sword Art Academy mod. Unfortunately, g_corpseRemovalTime isn't quick enough, as I need it to be instant. If at all possible, I would prefer to do this without coding, because I can't code for crap, thanks As far as I know it can't be done without coding. However, you can achieve this in a custom map if you give every NPC a custom deathscript that removes them when they die. The script should be like this: remove ( $get( STRING, "SET_PARM1" )$ ); And every single NPC in your map should have a parm1 command whose value is the same as the NPCs targetname. To activate the script, the NPC should have a deathscript command with a value that links it to the script above. I think that should work! Droidy365 likes this Link to comment
Langerd Posted February 8, 2018 Share Posted February 8, 2018 You can just simply make everyone undying. It will make them to 1hp BUT it will load deathscript. I suggest two things - One thing is adding the effect to the animation.cfg some explosion or something) and make deathscript that teleports everykilled person to the box somewhere in the map where is simple trigger_multiply that removes entity that it uses.. but it is something weird. It might work (because body cant disapear). I had a problem with scripts with kill or remove because i had to always type a name of the target entity.. i wanted overall effect - not just to one enitity only.The second thing which i less recommend is - give them undying on and deathscript to every enemy to just remove. about the effect.. i remember that Szico made barrels in his moonbase lab map that used the effects on the map. He made a script that was very comlicated - after the the death of the barrel the effect of explosion was taking origins of the barrel and showed up where barrel was. It was a little buggy in SP and it wasnt working everytime. Droidy365 likes this Link to comment
Droidy365 Posted February 10, 2018 Author Share Posted February 10, 2018 Ignore this one here, it's a double post lol.Just keep scrolling...... Link to comment
Droidy365 Posted February 10, 2018 Author Share Posted February 10, 2018 If it's a singleplayer map, make sure the player triggers a target_scriptrunner when he starts the map. As far as I know it can't be done without coding. However, you can achieve this in a custom map if you give every NPC a custom deathscript that removes them when they die. The script should be like this: remove ( $get( STRING, "SET_PARM1" )$ ); And every single NPC in your map should have a parm1 command whose value is the same as the NPCs targetname. To activate the script, the NPC should have a deathscript command with a value that links it to the script above. I think that should work!Ok, I have a few questions. For starters: How do you set up the parm1 command stuff? lol Link to comment
Langerd Posted February 10, 2018 Share Posted February 10, 2018 Ok, I have a few questions. For starters: How do you set up the parm1 command stuff? lolParm is as far as i know - it enables to make script much much more - universal. With one script we can parent it to the multiple entities. Or we can make script like this script that makes parm1 - give a 20armor parm2 - this guy(s) dieparm3 - they freeze later in gtkradiant - select the npc_spawner and in the key type - parm1 value- firstguy and select the other npc_spawner and make another key - key type - parm2 value- secondguy- select the scriptrunner and from what i remember - in the script runner you also need to type parm's. For this scriptrunner parm1's will be targeting enities with the name - firstguy and parm2's - secondguy it is hard for me to ... emmm describe.. maybe because i feel weird and my language is weak sorry EDIT: it doesnt need to be script_runner - in the npc_spawner you can add deathscript,spawnscript Link to comment
Droidy365 Posted February 10, 2018 Author Share Posted February 10, 2018 Actually, I turned off the Slow-Mo Camera Spin, and now it's a lot quicker - not instant, but quicker. But the question still remains - how will we get the effect to play as they die? Are either of you two good at coding? Thanks, again btw EDIT: Also, on a side note: How would you make a Team Icon appear like in MP and a custom health-bar that works like cg_debughealthbars and Force Sense?These are also for my Sword Art Academy mod lol. I have 3 Icons for 3 teams:gfx/misc/cursor_g (TEAM_PLAYER)gfx/misc/cursor_o (TEAM_NEUTRAL/FREE)gfx/misc/cursor_r (TEAM_ENEMY) Link to comment
Noodle Posted February 10, 2018 Share Posted February 10, 2018 Instead of troubling ourselves with words, I decided to just make a quick map demo that teaches you everything you need to know. https://www.dropbox.com/s/v6kc1jhoon7t8mb/self_remove_demo.pk3?dl=0 /devmap self_remove_demo to test the map and see the results for yourself.Open the .map file with gtkradiant to see the process. Open the self_remove.icarus file to see the simple script it involves. Enjoy modding! Link to comment
Droidy365 Posted February 11, 2018 Author Share Posted February 11, 2018 That's great! That part works perfectly! Now there's a few questions left:How do you do the same thing for the player?How do you get the explosion effect to play where they were when they died? (effects/sao/death_sparks.efx)Can this just be done within the script, or does it require coding?Thanks again, it works great! Link to comment
Noodle Posted February 11, 2018 Share Posted February 11, 2018 That's great! That part works perfectly! Now there's a few questions left:How do you do the same thing for the player?How do you get the explosion effect to play where they were when they died? (effects/sao/death_sparks.efx)Can this just be done within the script, or does it require coding?Thanks again, it works great! I don't think you can remove the player entity since it'd probably crash the game. Maybe you could try making him invisible when he dies? You just have to give the info_player_start entity a deathscript. I have no idea how you can make an FX play wherever you are.Maybe it can, but I'm not sure how. Droidy365 likes this Link to comment
Droidy365 Posted March 1, 2018 Author Share Posted March 1, 2018 I figured out a way to make the effect play as they die/disappear! Firstly, I added this line underneath every death animation in animevents.cfg: BOTH_DEATH1 AEV_EFFECT 83 sao/death_sparks.efx *pelvis 0 Then I made it so that the death animation only had 1 frame in animations.cfg, as the effects were only playing after the death animation was finished. Noodle and Langerd like this Link to comment
Langerd Posted March 1, 2018 Share Posted March 1, 2018 I figured out a way to make the effect play as they die/disappear! Firstly, I added this line underneath every death animation in animevents.cfg: BOTH_DEATH1 AEV_EFFECT 83 sao/death_sparks.efx *pelvis 0 Then I made it so that the death animation only had 1 frame in animations.cfg, as the effects were only playing after the death animation was finished.I told ya before cool that it works Droidy365 likes this Link to comment
Droidy365 Posted June 28, 2018 Author Share Posted June 28, 2018 I'm gonna revive this old thread: How can I make the player disappear like the NPCs?And also... EDIT: Also, on a side note: How would you make a Team Icon appear like in MP and a custom health-bar that works like cg_debughealthbars and Force Sense?These are also for my Sword Art Academy mod lol. I have 3 Icons for 3 teams:gfx/misc/cursor_g (TEAM_PLAYER)gfx/misc/cursor_o (TEAM_NEUTRAL/FREE)gfx/misc/cursor_r (TEAM_ENEMY) Link to comment
Noodle Posted July 3, 2018 Share Posted July 3, 2018 In most cases players behave in the same way as NPCs. You'd either need to add a 'affect player' command on icarus or just make the player entity have a deathscript in GTKradiant. Link to comment
JaceSolarisVIII Posted July 11, 2018 Share Posted July 11, 2018 Hey guys, I'm wondering how I can make corpses instantly disappear, while having a sort of explosion as they die. I want this to happen with all NPCs and Players that die. This is going to be for my Sword Art Academy mod. Unfortunately, g_corpseRemovalTime isn't quick enough, as I need it to be instant. If at all possible, I would prefer to do this without coding, because I can't code for crap, thanks You can do the explosion effect using code edits. Search for "DeathFX" in the code and edit it to include all classes of model or the ones you want the effect to happen on. And set the corpse removal time to 2 seconds (this will give time for the deathfx to happen). Hope this helps. Link to comment
Droidy365 Posted July 11, 2018 Author Share Posted July 11, 2018 You can do the explosion effect using code edits. Search for "DeathFX" in the code and edit it to include all classes of model or the ones you want the effect to happen on. And set the corpse removal time to 2 seconds (this will give time for the deathfx to happen). Hope this helps. Hey guys, I'm wondering how I can make corpses instantly disappear, while having a sort of explosion as they die. I want this to happen with all NPCs and Players that die. This is going to be for my Sword Art Academy mod. Unfortunately, g_corpseRemovalTime isn't quick enough, as I need it to be instant. If at all possible, I would prefer to do this without coding, because I can't code for crap, thanks However, I was thinking about doing something like this, as it would be much more convenient than constantly having to add scripts to everything. CLASS_R2D2 explodes in a similar way to what I've described, would it be possible to make every class do that? Just FYI, I'm not a coder. Link to comment
JaceSolarisVIII Posted July 12, 2018 Share Posted July 12, 2018 However, I was thinking about doing something like this, as it would be much more convenient than constantly having to add scripts to everything. CLASS_R2D2 explodes in a similar way to what I've described, would it be possible to make every class do that? Just FYI, I'm not a coder. Well as long as you know how to "Open" and "Compile" the code then your half way there.https://github.com/JACoders/OpenJK/wiki/Compilation-guideOnce you have figured this bit out just "search" for "void DeathFX( gentity_t *ent )". It is a very,very simple bit of code. switch(ent->client->NPC_class) { case CLASS_MOUSE: VectorCopy( ent->currentOrigin, effectPos ); effectPos[2] -= 20; G_PlayEffect( "env/small_explode", effectPos ); G_SoundOnEnt( ent, CHAN_AUTO, "sound/chars/mouse/misc/death1" ); break; case CLASS_PROBE: VectorCopy( ent->currentOrigin, effectPos ); effectPos[2] += 50; G_PlayEffect( "explosions/probeexplosion1", effectPos ); break; case CLASS_ATST: AngleVectors( ent->currentAngles, NULL, right, NULL ); VectorMA( ent->currentOrigin, 20, right, effectPos ); effectPos[2] += 180; G_PlayEffect( "explosions/droidexplosion1", effectPos ); VectorMA( effectPos, -40, right, effectPos ); G_PlayEffect( "explosions/droidexplosion1", effectPos ); break; All you need to do is add the classes to the different type of explosion effects you want. EXAMPLE: switch(ent->client->NPC_class) { case CLASS_ADDED CLASS NAME HERE: case CLASS_MOUSE: VectorCopy( ent->currentOrigin, effectPos ); effectPos[2] -= 20; G_PlayEffect( "env/small_explode", effectPos ); G_SoundOnEnt( ent, CHAN_AUTO, "sound/chars/mouse/misc/death1" ); break; case CLASS_PROBE: case CLASS_ADDED CLASS NAME HERE: VectorCopy( ent->currentOrigin, effectPos ); effectPos[2] += 50; G_PlayEffect( "explosions/probeexplosion1", effectPos ); break; case CLASS_ATST: case CLASS_ADDED CLASS NAME HERE: AngleVectors( ent->currentAngles, NULL, right, NULL ); VectorMA( ent->currentOrigin, 20, right, effectPos ); effectPos[2] += 180; G_PlayEffect( "explosions/droidexplosion1", effectPos ); VectorMA( effectPos, -40, right, effectPos ); G_PlayEffect( "explosions/droidexplosion1", effectPos ); break; Then just compile the code and use the newly created dlls and exe,s in your mod. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now