Dexter987 Posted February 7, 2017 Posted February 7, 2017 All of this is about singleplayer. Want all staff sabers to be breaking in dual saber stance during a battle and all dual saber stance could be break in one saber stance in combat! *I use Clone wars v6 stance and i was wandering if there is a way to add or replace idles stances?
minilogoguy18 Posted February 7, 2017 Posted February 7, 2017 You can cut the staffs in half already but there is no code supporting the destruction of a weapon. The staff cutting is very rare, timing is everything, the game didn't have "broken" sabers by default it would make the NPC use 2 stinger (reborn) hilts. I made a file that fixes that but to break a left handed saber some coding would have to be done. https://jkhub.org/files/file/1430-broken-staff-sabers-for-sp/
Dexter987 Posted February 8, 2017 Author Posted February 8, 2017 Despite all effort i can't make it break i realise it's breakable but it hard to break the staff!!!I need a way to make it break easly??Any advise? code etc....
minilogoguy18 Posted February 8, 2017 Posted February 8, 2017 I don't know if it's possible to increase the odds of it breaking with code change, it might just be that it's hard to hit the staff given it's small and constantly moving. @@eezstreet @@Xycaleth anything in the code that could increase the odds?
MGummelt Posted February 9, 2017 Posted February 9, 2017 You're right, it only breaks the lightsaber if:1) The .saber ext_data file specifies a "brokensaber" for the saber you hitAND2) They're not in a transition animation or in the middle of an attackAND3) You hit their lightsaber model If all are true, it's 100% from WP_BreakSaber(): if ( !ent->client->ps.saber[0].brokenSaber1 ) {//not breakable into another type of saber return qfalse;} if ( PM_SaberInStart( ent->client->ps.saberMove ) //in a start|| PM_SaberInTransition( ent->client->ps.saberMove ) //in a transition|| PM_SaberInAttack( ent->client->ps.saberMove ) )//in an attack{//don't break when in the middle of an attack return qfalse;} if ( Q_stricmpn( "w_", surfName, 2 ) && Q_stricmpn( "saber", surfName, 5 ) //hack because using mod-community made saber&& Q_stricmp( "cylinder01", surfName ) )//hack because using mod-community made saber{//didn't hit my weapon return qfalse;} swegmaster, Archangel35757, Dexter987 and 1 other like this
Dexter987 Posted February 10, 2017 Author Posted February 10, 2017 3) You hit their lightsaber model* Somethink like a kick can do it? *It's only one hit right?...I know they have already made a script for it!Can i change the conditions?Level health for example?
MGummelt Posted February 10, 2017 Posted February 10, 2017 3) You hit their lightsaber model* Somethink like a kick can do it? *It's only one hit right?...I know they have already made a script for it!Can i change the conditions?Level health for example? It only works with damage from a lightsaber. In G_GetHitLocFromSurfName() inside g_combat.cpp: else if ( mod == MOD_SABER && WP_BreakSaber( ent, surfName, saberType ) ){//saber hit and broken*hitLoc = HL_HAND_RT;} You could change that to ( mod == MOD_SABER || mod == MOD_MELEE ), or add whatever other damage types you want (MOD_ = "method of damage/death"). However, I'm not sure our melee damage traces look for specific body parts as that is a more expensive trace to do. I think our melee traces (like kicks) only check to see if they hit the player/NPC's bounding box, not where on their actual model they hit. But you could change that if you want. Alternatively, you could fake it. Detect when someone has been kicked in the front when idling and use a probability to decide if the hit broke their saber (you could do a distance check between the attacker's foot bone and the victim's saber origin). Look in G_KickTrace() inside g_active.cpp. When it calls G_Damage() in there, you can check to see if you should break their saber, then call WP_BreakSaber and pass in the surfName of the saber (you can just fake the surfName by passing in "saber"). BTW, set g_debugMelee to 1 to be able to do an extended set of melee moves any time you want - kicks, punches, grapples and throws. I think you press the activate/use key and a direction at the same time? Dexter987 and Tempust85 like this
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