-
Posts
2,023 -
Joined
-
Last visited
Community Answers
-
Asgarath83's post in Need Help for Discord was marked as the answer
Fixed Installing Discord App on Smartphone 🙂
-
Asgarath83's post in I need help creating a script. was marked as the answer
Hello.
There are two different methods for do that.
Method1:TargetCounter. the more easy.
1 - The NPCs that you need to protect should have as NPC_target the targetname value of the targetcounter. we will call it "failcounter"
so
NPC_target failcounter
2 -make a target_counter. it's targetname is failcounter.
set
count 3
target failrunner
3 - create a targetscriptrunner
targetname: failrunner
Usescript: mapname/failmission
4 - On Behaved use that:
SET_MISSIONFAILED as value:
TOOMANYALLIEDHASDIED
build the map and the script.
got it! 😄
Yes, that's the better way 🙂
Method2: behaved variables
another way is more complicated and require to declair a variable into icarus
declair "failedmission"
set failedmission, 0
when your NPC died, have as NPC_target failrunner
and they run directly the failrunner script instead of a target_counter
in that case the failrunner works like the t1_danger script that add ++1 on the failedmission variable value each time the script is runned.
when you get 3 as value of your variable you run the SET_MISSIONFAILED TOOMANYALLIEDDIED .
you can do that with an "if" field, exactly like t1_danger
-
Asgarath83's post in Jedi Academy maps by using Blender was marked as the answer
Sure, sorry for late, i am a lot sick
-
Asgarath83's post in Change Ammo Amount for NPC Dropped Weapons (SP) was marked as the answer
I found what you're looking for.
search on openjk code.
/*
=================
TossClientItems
Toss the weapon and powerups for the killed player
=================
*/ on code/g_combat.cpp
THEN...Go down until you find that:
else {//FIXME: base this on the NPC's actual amount of ammo he's used up... switch ( weapon ) { case WP_BRYAR_PISTOL: case WP_BLASTER_PISTOL: dropped->count = 20; break; case WP_BLASTER: dropped->count = 20; break; case WP_DISRUPTOR: dropped->count = 20; break; case WP_BOWCASTER: dropped->count = 20; break; case WP_REPEATER: dropped->count = 20; break; case WP_DEMP2: dropped->count = 20; break; case WP_FLECHETTE: dropped->count = 20; break; case WP_ROCKET_LAUNCHER: dropped->count = 3; break; case WP_CONCUSSION: dropped->count = 100;//12; break; case WP_THERMAL: dropped->count = 5; break; case WP_TRIP_MINE: dropped->count = 3; break; case WP_DET_PACK: dropped->count = 1; break; case WP_STUN_BATON: dropped->count = 20; break; case WP_ATST_MAIN: dropped->count = 10; break; case WP_ATST_SIDE: dropped->count = 15; break; case WP_EMPLACED_GUN: dropped->count = 20; break; case WP_TUSKEN_RIFLE: dropped->count = 10; break; now change the count value as your will.
You need however:
-Openjk
-Visualstudio
-Basic C++ knowledge
-Basic Knowledge for build a edited dll and exe files for override the game executable with the change
NOTE: IMPORTANT: back up your default dll and exe of JKA before do that.
Special thanks to @@eezstreet for pointed me into the right way.
-
Asgarath83's post in What code calls for smokeTrail? was marked as the answer
is hardcoded.
basically for the effect opf weapons into JKA code, they are scattered into differente functions.
hitwall,bouncewalleffect and hitperson effect are into cg_missilehitwall cg_missilebounce(or sometjhing like that) and cg_missilehitplayer . bounce is for EFX of flechette and bowcasters bouncing shoots.
For the FX of shoots of the weapons: check the FX files of weapons.
For the muzzle \ altmuzzle efx of the weapons: check the wp_ file of the weapons.
but they are damned hardcoded for be called to the silly weapons.dat. i am working to a RPG code rewrite that add a ton of easy modding feature on JKA, and also a space fighter cobmat as rogue squadron 3d \ x wing alliance on Single Player.
i hope when i end to share this code with all.
tmy project also related to allow a full customization of weapons models and effects . and a beter customization of force power effects too with WPN files as JKG mod or the NPC files itself.
is silly that this stuff is hardcoded. not leady any way for the imagination of modders.
however the smoke trail i think is called into wp_disruptor.cpp and wp_concussion.cpp that deal the function sof the weapons logic. check the alt fire shoot functions. there is something about Q3_INFINITE this is the functions called for a shoot of infinite velocity and istalty damage like the beams ray of these weapons.
the smoke trail is rendered when you shoot with the altfire beams of these weapons.
void FX_ConcAltMiss( vec3_t origin, vec3_t normal ) { //gentity_t self; vec3_t pos, c1, c2; VectorMA( origin, 4.0f, normal, c1 ); VectorCopy( c1, c2 ); c1[2] += 4; c2[2] += 12; VectorAdd( origin, normal, pos ); pos[2] += 28; FX_AddBezier( origin, pos, c1, vec3_origin, c2, vec3_origin, 6.0f, 6.0f, 0.0f, 0.0f, 0.2f, 0.5f, WHITE, WHITE, 0.0f, 4000, cgi_R_RegisterShader( "gfx/effects/smokeTrail" ), FX_ALPHA_WAVE ); theFxScheduler.PlayEffect( "concussion/alt_miss", origin, normal ); } is FX_AddBezier
i never edited it. is on FXutil.cpp
//------------------------- // FX_AddBezier //------------------------- CBezier *FX_AddBezier( const vec3_t start, const vec3_t end, const vec3_t control1, const vec3_t control1Vel, const vec3_t control2, const vec3_t control2Vel, float size1, float size2, float sizeParm, float alpha1, float alpha2, float alphaParm, const vec3_t sRGB, const vec3_t eRGB, const float rgbParm, int killTime, qhandle_t shader, int flags ) { if ( theFxHelper.mFrameTime < 1 ) { // disallow adding new effects when the system is paused return 0; } CBezier *fx = new CBezier; if ( fx ) { fx->SetOrigin1( start ); fx->SetOrigin2( end ); fx->SetControlPoints( control1, control2 ); fx->SetControlVel( control1Vel, control2Vel ); // RGB---------------- fx->SetRGBStart( sRGB ); fx->SetRGBEnd( eRGB ); if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE ) { fx->SetRGBParm( rgbParm * PI * 0.001f ); } else if ( flags & FX_RGB_PARM_MASK ) { // rgbParm should be a value from 0-100.. fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime ); } // Alpha---------------- fx->SetAlphaStart( alpha1 ); fx->SetAlphaEnd( alpha2 ); if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE ) { fx->SetAlphaParm( alphaParm * PI * 0.001f ); } else if ( flags & FX_ALPHA_PARM_MASK ) { fx->SetAlphaParm( alphaParm * 0.01f * killTime + theFxHelper.mTime ); } // Size---------------- fx->SetSizeStart( size1 ); fx->SetSizeEnd( size2 ); if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE ) { fx->SetSizeParm( sizeParm * PI * 0.001f ); } else if ( flags & FX_SIZE_PARM_MASK ) { fx->SetSizeParm( sizeParm * 0.01f * killTime + theFxHelper.mTime ); } fx->SetShader( shader ); fx->SetFlags( flags ); fx->SetSTScale( 1.0f, 1.0f ); FX_AddPrimitive( (CEffect**)&fx, killTime ); } return fx; } -
Asgarath83's post in magic appearance of a misc model after another misc model is destroyed? was marked as the answer
well... maybe a func_usable or func_static with unactive field setted and model2 key with model spawnflag? not sure, i never tryed. into jedi outcast there is the first map when kyle destroy a reactor and reactor push a looong deadly flame into a tunnel. you need to wait that flame is expired for pass without die and pass throught reactors's ruined. i think you need to decompile this map and see how works this part of level, on radiant and on icarus too. so decompile also with dehaveb the scripts of JO first level.
-
Asgarath83's post in Help, if anyone knows. was marked as the answer
you want to set a playermodel directly with the batch file for execute the mod? i not know if is possible. is possible to do by the start menu when you begin your first level mod. simply edit newgame_first menu and add the cvars for customize model, sex and sound before execute the level and loading the first map. this require an editring of the menu files.
folder ui \ newgame_first.menu edit with notepad
the menu files are wrote in a language like html.
edit the next button fied like in this way
// NEXT button itemDef { name next_glow group mods style WINDOW_STYLE_SHADER rect 455 444 130 24 background "gfx/menus/menu_buttonback" // Frame around button forecolor 1 1 1 1 visible 0 decoration } itemDef { name nextbutton group fade_buttons text @MENUS_NEXT descText @MENUS_NEXT_DESC type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect 455 444 130 24 font 3 textscale 1 textalignx 65 textaligny -1 textalign ITEM_ALIGN_CENTER textstyle 3 forecolor 1 .682 0 1 visible 1 action { play "sound/interface/button1.wav" setcvar snd "jaden_male" // put sound folder of your character setcvar g_char_model "character" // put models/player/ name folder of you character setcvar g_char_skin_head "head_a1" // skin file for head setcvar g_char_skin_torso "torso_f1" // skin file for torso setcvar g_char_skin_legs "lower_b1" // skin file for legs. these two files are facoltative. setcvar sex "m" // sex for character. male -> m \ female -> f setcvar g_saber "sword1" //saber name by saber file setcvar g_saber_color "orange" // saber color red blue orange green purple yellow uiScript "updatecharcvars" close all play "sound/weapons/Air_Reaver/airreaver1.mp3" // a sound you want to play when start the game exec "map mapname" // first level map exec "helpusobi 1" // enable cheats and debug command consoklle exec "wait 30" exec "playermodel character" // this auto read an eventually NPC files of your character and set all force powers and weapons like NPC file assign. } mouseEnter { show next_glow } mouseExit { hide next_glow } } } } -
Asgarath83's post in I need help with the creation of prefabricated buildings. was marked as the answer
https://opengameart.org/content/modular-building-asset-0 i not know how much they can help you but should be a start point.
https://opengameart.org/content/modular-3d-buildings
give a look
https://opengameart.org/art-search?keys=modular
the problem is to convert and port all these nice stuff into radiant and convert into brush or misc models... but misc model need collision! >.< ... so, good luck man.
-
Asgarath83's post in Help with multiple Mind Trick was marked as the answer
years ago I created a radius stunning attack for certain classes with kain mind reaver AOE attack. you need to work about force repulse code of JAE for your mindtrickradius force power.
put knockback value and dmg to zero and set mindtrick confusiontime on push_list[x] entities hitted by the shockwave that aren't jedi \ sith classes and do not use saber as weapon
-
Asgarath83's post in Changing NPC model by force power was marked as the answer
Update: create a new function for changing model of NPC not work much good. at the end i found an alternative.
i hope this solution can be useful for someone that need a coded mod when enemies change they appereance by code, without scripting, for deep gameplay purposes.
and so what you need to do is basically this:
1 create NPC file of new model with parms of force power, aggresssion, sound etc etc.
do: put this as changing code
traceEnt, if you to affect an enemy hit by telepathy \ forcelightning
self: for affected the playermodel itself of caster.
ent: for generical ent NPC changing.
gripent: for changing model of a NPC gripped
drainent: for changing model of a npc drained
victim: for changing model of an npc hit by a saber
activator: this should affected enemy hitted by grenades-.
attacker\ attacked: rarely, but is possible to use also that in some conditions.
G_removeweaponmodels remove weapon model or saber model of NPC before morphing
npcparseparm read the NPC script and parse his information on model
reloadsaberdata reset saber information (if old NPC get dual sabers, this should be useful for avoid to New NPC to have again on left hand the old saber)
Addweaponmodel is necessary because if not the new saber is not visible and not do damage.
G_RemoveWeaponModels ( traceEnt ); G_RemovePlayerModel( traceEnt ); NPC_ParseParms( "neoproxy", traceEnt ); G_ReloadSaberData( traceEnt ); traceEnt->s.weapon = WP_SABER; G_AddWeaponModels( traceEnt ); -
Asgarath83's post in Switching weapon by saber to... was marked as the answer
Nevermind, i found the problem: when a NPC go into NPC_FENCER state and use the saber when enemy is close, it's also called a function in NPC.cpp that set behavour state of NPC to defauit jedi state (turning off my AI ) . this is valid for all saberist classes and is the motivation because is so difficult to switch weapons in code between sabers and projectiles.
the problem is about the condition that set jedi behavour for all NPC equipped with WP_SABER. i fixed setting the condition for all NPC that give a saber and of a class different by the class when i am testing the AI. now is okay. and there is a perfect switch between ranged and sword attack. so the code i'm working is fine, but i need a little fix on npc.cpp for avoid this problem. also is a careful thing because there is the risk to deactivate AI for all saberist of other classes.
-
Asgarath83's post in "If" Icarus was marked as the answer
you can check how works t1_danger icarus codes.
it fires up the end of the level only when jaden take fourth item and place it into the damaged ship. there are 2 interessing if \ else field in this map code, you can create something like that, but instead of setting the various Jaden sound voice, when happen something you can set SET_OBJECTIVE or SET_OBJECTIVE_CLEAR with name of objectives.
(now i not remember exactly how are named the icarus setting names)
-
Asgarath83's post in Change misc NS turret Blaster Shoot Fx was marked as the answer
Fixed, now works like the emplaced gun
-
Asgarath83's post in Shader issue... Water and Lava doesnt work was marked as the answer
about watershader brushes sctructures, they need to get the water texture on the top and the bottom, and the caulk_water texture on the
sides
about the shader of the waters. make sure they have q3map_material water as parameter. the "water" material of a brush is builded during the building of the map. so for working a water, you need to have a shader water, a shaderlist with the file that contain the watershader into the list as name. and all these into the radiant shaders path correct. also textures of water shader need to be in the correct path.
for see builed water into the engine, you need to copy shader file and texture of water inside your mod path.
-
Asgarath83's post in "EffectsEd" lost the path to shader files was marked as the answer
or if you haven't the shader files placed correctly into the .SHADER folder,
or that is caused by some Shader file with some brank broken and not good closed. it happened also to me.
-
Asgarath83's post in ICARUS forcé lightning was marked as the answer
Sure,
with SET_FORCE_LIGHTNING , true.
you force a NPC with force lightning power to shoot it.
-
Asgarath83's post in Script that change player model - Uses NPC was marked as the answer
there is two way:
1: you can take your pc and drown it in a pool of sulfureum acid, but there is the possibility of a little damage of hard disk... if this work for your mod you are very lucky! there is only 1 probability into all universe history this can work! XD
2: okay, i am serious. you need to start a game with morin as character, right?
well, you need to edit newgame_first.menu file.
at the end about the Next button for making a new game after you selected the difficult set this:
itemDef { name nextbutton group fade_buttons text @MENUS_NEXT descText @MENUS_NEXT_DESC type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect 455 444 130 24 font 3 textscale 1 textalignx 65 textaligny -1 textalign ITEM_ALIGN_CENTER textstyle 3 forecolor 1 .682 0 1 visible 1 action { play "WHATEVER SOUND YOU WANT example: sound/weapons/Spirit_Reaver/spiritreaver2.mp3" close all // PLAYERMODEL SETTINGS setcvar g_char_model "Morin" setcvar g_char_skin_head "head_a1" setcvar g_char_skin_torso "torso_a1" setcvar g_char_skin_legs "lower_a1" setcvar g_char_color_red "255" setcvar g_char_color_green "255" setcvar g_char_color_blue "255" setcvar sex "m" snd "Morin" //PUT HERE the path of morin sounds example: "sound/chars/Morin" sndcombat "Morin" sndjedi "Morin" sndextra "Morin" uiScript "updatecharcvars" setcvar saber_menu 0 setcvar ui_saber_type single exec "map morin1" // PUT HERE THE NAME OF YOUR MAP } mouseEnter { show next_glow } mouseExit { hide next_glow } } PRETTY IMPORTANT: you need into the folder of your model (models/players/morin) you get these skin file:
Model_default.skin head_a1.skin, torso_a1.skin, lower_a1.skin , lower_e1.skin and torso_g1.skin
lower e1 and torsog1 set the dresses for Hoth level (in case you want morin go to a frost planet modding the hoth map XD )
head, torso and lower a1 set the texture path for head, torso and arms, hips and legs.
i hope you know how to make skin file of you character because engine read textures of chars by SKIN files of the models.
you can set also playermodel on icarus with SET_PLAYERMODEL morin, but this not change the g_char value of your model and not allocate into the save memory, you need to change model by menu. SET_PLAYERMODEL script on Icarus simply change your morin with an eventual Morin.npc file and set Morin exactlry with saber and force power you setted into a Npc file.
understood? is a fast way for set his force power and his saber.
PS: i suggest you also to look into coding section my thread about creating a new class. is not about a new coded class, but explain how customize weapon projectiles effect at second of class using . example: if weapon_blatser is used by CLASS_HAZARDTROOOPER... you can see how change his visual and sound effect! maybe can be useful for your magic mod because you can add more elemental spell projectile and visual effect without adding new weapons. simply, every class so can shoot customize effect of elemental attack.
i have also done a tutorial about adding new weapons into SP game, but it again need approvation of the team. i think team now want correct my Engrish error and want verify if my teachings are corrects.
on my tutorial i will explain also how to set dmg of weapons by hitted classes, like DEMP2 is letal on droid, in case you wanna make in your mod elemental weakness or immunity to the morin spells on the opponents.
-
Asgarath83's post in [SP] Scaling The Player? was marked as the answer
Yes, pretty easy @@MagSul add the following line into the cvar option of the button that activate the level when clicked, into the previous menu that start the level:
playermodel tiny
wait 10
map "namelevel"
and make an NPC file called tiny when the playermodel is "playermodel player" with a scale 90 or any value you desire. you want to make the tales of a giant jedi or a little ant?
-
Asgarath83's post in Scripting a enemy character to change level upon death. was marked as the answer
target_level_change as told Rramikad on deathscript,
but you need also to make a fade in camera into the script for make the fading in black, if you want a fading.
After this a "wait 200" for wait for 0.2 seconds, and "use **"
** is the targetname of the target_level_change entity.
-
Asgarath83's post in anyone knows how to put the blaster pistol in GtkRadiant not know if it is a script. Please someone tell me was marked as the answer
yes, there is a code restriction that avoid dropping of same weapons. Blaster pistol is one of that.
@@scp_chaos1
mmm what can yoo do man?
you can study the map t1_danger when player can take some items device for repair damaged shuttle and leave planet of wormes creatures.
you need
1 to put a misc_model of weapon_blaster model into your map.
2: to make a func_usable brush startedon.
3: linked the md3 model of blaster to func_usable
4: a trigger once around all that.
the trigger run a script that activate the func_usable, setting it to off. this can remove the weapon_blaster_pistol by level.
can you use the "use" func_usable targetname or the remove "func usable targetname" command with icarus.
5: into the script add
"affect player" SET_WEAPON WEAPON_BLASTER_PISTOL after removed the models
-
Asgarath83's post in Different Visual Efx for Bryar, blaster and jawa weapon. was marked as the answer
Okay! I fix this!
I copy here my edit code if someone desire to use for his mod is free to do!
this code hallow to change efx to WP_BRYAR_PISTOL and WP_JAWA, instead of have the same of WP_BLASTER_PISTOL in this mod the Npcs of your mod can got a more weapon variety. WP_BRYAR_PISTOL work like WP_BLASTER_PISTOL. WP_JAWA is a rapid fire repeater.
you can simply replace "bow" and "howler" with your personal definition for your code.
this is for SINGLE PLAYER game, not for MP.
First step:
go in cg_local.h and add this after void FX_saber . these add the definition fpr the NEW visual efx.
void FX_BryarHitWall( vec3_t origin, vec3_t normal ); void FX_BryarAltHitWall( vec3_t origin, vec3_t normal, int power ); void FX_BryarHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ); void FX_BryarAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ); void FX_BowHitWall( vec3_t origin, vec3_t normal ); void FX_BowAltHitWall( vec3_t origin, vec3_t normal, int power ); void FX_BowHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ); void FX_BowAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ); void FX_HowlerHitWall( vec3_t origin, vec3_t normal ); void FX_HowlerAltHitWall( vec3_t origin, vec3_t normal, int power ); void FX_HowlerHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ); void FX_HowlerAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ) second step:
cg_media.h add the definition of your new efx played by the FX functions add this on fx_handle table
// BLASTER PISTOL DARKNESS fxHandle_t bryarShotEffect; fxHandle_t bryarPowerupShotEffect; fxHandle_t bryarWallImpactEffect; fxHandle_t bryarWallImpactEffect2; fxHandle_t bryarWallImpactEffect3; fxHandle_t bryarFleshImpactEffect; // BOW - BRYAR PISTOL fxHandle_t bowShotEffect; fxHandle_t bowPowerupShotEffect; fxHandle_t bowWallImpactEffect; fxHandle_t bowWallImpactEffect2; fxHandle_t bowWallImpactEffect3; fxHandle_t bowFleshImpactEffect; // JAWA - SONIC PISTOL fxHandle_t howlerShotEffect; fxHandle_t howlerPowerupShotEffect; fxHandle_t howlerWallImpactEffect; fxHandle_t howlerWallImpactEffect2; fxHandle_t howlerWallImpactEffect3; fxHandle_t howlerFleshImpactEffect; third step:
cg_weaponLoad.cpp
add this for add in weapons.dat the new func definition of projectiles.
func_t funcs[] = { {"bryar_func", FX_BryarProjectileThink}, {"bryar_alt_func", FX_BryarAltProjectileThink}, {"bow_func", FX_BowProjectileThink}, {"bow_alt_func", FX_BowAltProjectileThink}, {"howler_func", FX_HowlerProjectileThink}, {"howler_alt_func", FX_HowlerAltProjectileThink}, Now the hardest part. Cg_weapons.cpp
found the case WP_BRYAR_PISTOL
case WP_BLASTER_PISTOL
and CASE_WP_JAWA switch, as you can see they got the effects displayed in common.
edit in this:
Now go in cg_missilehitwall part of the same file. edit like this the switch case of BRYAR \ BLASTER \ JAWA. this customize the wall impact efx. basically this told "if weapon is that, play this efx, if is another play this other efx, etc."
void CG_MissileHitWall( centity_t *cent, int weapon, vec3_t origin, vec3_t dir, qboolean altFire ){ int parm; switch( weapon ) { case WP_BRYAR_PISTOL: if ( altFire ) { parm = 0; if ( cent->gent ) { parm += cent->gent->count; } FX_BowAltHitWall( origin, dir, parm ); } else { FX_BowHitWall( origin, dir ); } break; case WP_BLASTER_PISTOL: if ( altFire ) { parm = 0; if ( cent->gent ) { parm += cent->gent->count; } FX_BryarAltHitWall( origin, dir, parm ); } else { FX_BryarHitWall( origin, dir ); } break; case WP_JAWA: if ( altFire ) { parm = 0; if ( cent->gent ) { parm += cent->gent->count; } FX_HowlerAltHitWall( origin, dir, parm ); } else { FX_HowlerHitWall( origin, dir ); } break; case WP_BLASTER: FX_BlasterWeaponHitWall( origin, dir ); break;same thing for Flesh impact efx of when weapons hit a NPC or player
void CG_MissileHitPlayer( centity_t *cent, int weapon, vec3_t origin, vec3_t dir, qboolean altFire ) { gentity_t *other = NULL; qboolean humanoid = qtrue; if ( cent->gent ) { other = &g_entities[cent->gent->s.otherEntityNum]; if( other->client ) { class_t npc_class = other->client->NPC_class; // check for all droids, maybe check for certain monsters if they're considered non-humanoid..? if ( npc_class == CLASS_SEEKER || npc_class == CLASS_PROBE || npc_class == CLASS_MOUSE || npc_class == CLASS_GONK || npc_class == CLASS_R2D2 || npc_class == CLASS_R5D2 || npc_class == CLASS_PROTOCOL || npc_class == CLASS_MARK1 || npc_class == CLASS_MARK2 || npc_class == CLASS_INTERROGATOR || npc_class == CLASS_ATST || npc_class == CLASS_SENTRY ) { humanoid = qfalse; } } } switch( weapon ) { case WP_BRYAR_PISTOL: if ( altFire ) { FX_BowAltHitPlayer( origin, dir, humanoid ); } else { FX_BowHitPlayer( origin, dir, humanoid ); } break; case WP_BLASTER_PISTOL: if ( altFire ) { FX_BryarAltHitPlayer( origin, dir, humanoid ); } else { FX_BryarHitPlayer( origin, dir, humanoid ); } break; case WP_JAWA: if ( altFire ) { FX_HowlerAltHitPlayer( origin, dir, humanoid ); } else { FX_HowlerHitPlayer( origin, dir, humanoid ); } break; At the end, for FX_bryarpistol.cpp you need to edit this part of code that get the definition of each efx called and displayed by FX parameters you added in cg_local.h
so now the FX functions are working and they called the specific efxs you have add on cg_weapons.cpp first edit part.
------------------------- MAIN FIRE ------------------------- FX_BryarProjectileThink ------------------------- */ void FX_BryarProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ) { vec3_t forward; if ( VectorNormalize2( cent->gent->s.pos.trDelta, forward ) == 0.0f ) { if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f ) { forward[2] = 1.0f; } } // hack the scale of the forward vector if we were just fired or bounced...this will shorten up the tail for a split second so tails don't clip so harshly int dif = cg.time - cent->gent->s.pos.trTime; if ( dif < 75 ) { if ( dif < 0 ) { dif = 0; } float scale = ( dif / 75.0f ) * 0.95f + 0.05f; VectorScale( forward, scale, forward ); } if ( cent->gent && cent->gent->owner && cent->gent->owner->s.number > 0 ) { theFxScheduler.PlayEffect( "bryar/NPCshot", cent->lerpOrigin, forward ); } else { theFxScheduler.PlayEffect( cgs.effects.bryarShotEffect, cent->lerpOrigin, forward ); } } void FX_BowProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ) { vec3_t forward; if ( VectorNormalize2( cent->gent->s.pos.trDelta, forward ) == 0.0f ) { if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f ) { forward[2] = 1.0f; } } // hack the scale of the forward vector if we were just fired or bounced...this will shorten up the tail for a split second so tails don't clip so harshly int dif = cg.time - cent->gent->s.pos.trTime; if ( dif < 75 ) { if ( dif < 0 ) { dif = 0; } float scale = ( dif / 75.0f ) * 0.95f + 0.05f; VectorScale( forward, scale, forward ); } if ( cent->gent && cent->gent->owner && cent->gent->owner->s.number > 0 ) { theFxScheduler.PlayEffect( "bow/NPCshot", cent->lerpOrigin, forward ); } else { theFxScheduler.PlayEffect( cgs.effects.bowShotEffect, cent->lerpOrigin, forward ); } } void FX_HowlerProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ) { vec3_t forward; if ( VectorNormalize2( cent->gent->s.pos.trDelta, forward ) == 0.0f ) { if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f ) { forward[2] = 1.0f; } } // hack the scale of the forward vector if we were just fired or bounced...this will shorten up the tail for a split second so tails don't clip so harshly int dif = cg.time - cent->gent->s.pos.trTime; if ( dif < 75 ) { if ( dif < 0 ) { dif = 0; } float scale = ( dif / 75.0f ) * 0.95f + 0.05f; VectorScale( forward, scale, forward ); } if ( cent->gent && cent->gent->owner && cent->gent->owner->s.number > 0 ) { theFxScheduler.PlayEffect( "howler/NPCshot", cent->lerpOrigin, forward ); } else { theFxScheduler.PlayEffect( cgs.effects.howlerShotEffect, cent->lerpOrigin, forward ); } } /* ------------------------- FX_BryarHitWall ------------------------- */ void FX_BryarHitWall( vec3_t origin, vec3_t normal ) { theFxScheduler.PlayEffect( cgs.effects.bryarWallImpactEffect, origin, normal ); } void FX_BowHitWall( vec3_t origin, vec3_t normal ) { theFxScheduler.PlayEffect( cgs.effects.bowWallImpactEffect, origin, normal ); } void FX_HowlerHitWall( vec3_t origin, vec3_t normal ) { theFxScheduler.PlayEffect( cgs.effects.howlerWallImpactEffect, origin, normal ); } /* ------------------------- FX_BryarHitPlayer ------------------------- */ void FX_BryarHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ) { theFxScheduler.PlayEffect( cgs.effects.bryarFleshImpactEffect, origin, normal ); } void FX_BowHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ) { theFxScheduler.PlayEffect( cgs.effects.bowFleshImpactEffect, origin, normal ); } void FX_HowlerHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ) { theFxScheduler.PlayEffect( cgs.effects.howlerFleshImpactEffect, origin, normal ); } /* ------------------------- ALT FIRE ------------------------- FX_BryarAltProjectileThink ------------------------- */ void FX_BryarAltProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ) { vec3_t forward; if ( VectorNormalize2( cent->gent->s.pos.trDelta, forward ) == 0.0f ) { if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f ) { forward[2] = 1.0f; } } // hack the scale of the forward vector if we were just fired or bounced...this will shorten up the tail for a split second so tails don't clip so harshly int dif = cg.time - cent->gent->s.pos.trTime; if ( dif < 75 ) { if ( dif < 0 ) { dif = 0; } float scale = ( dif / 75.0f ) * 0.95f + 0.05f; VectorScale( forward, scale, forward ); } // see if we have some sort of extra charge going on for ( int t = 1; t < cent->gent->count; t++ ) { // just add ourselves over, and over, and over when we are charged theFxScheduler.PlayEffect( cgs.effects.bryarPowerupShotEffect, cent->lerpOrigin, forward ); } theFxScheduler.PlayEffect( cgs.effects.bryarShotEffect, cent->lerpOrigin, forward ); } void FX_BowAltProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ) { vec3_t forward; if ( VectorNormalize2( cent->gent->s.pos.trDelta, forward ) == 0.0f ) { if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f ) { forward[2] = 1.0f; } } // hack the scale of the forward vector if we were just fired or bounced...this will shorten up the tail for a split second so tails don't clip so harshly int dif = cg.time - cent->gent->s.pos.trTime; if ( dif < 75 ) { if ( dif < 0 ) { dif = 0; } float scale = ( dif / 75.0f ) * 0.95f + 0.05f; VectorScale( forward, scale, forward ); } // see if we have some sort of extra charge going on for ( int t = 1; t < cent->gent->count; t++ ) { // just add ourselves over, and over, and over when we are charged theFxScheduler.PlayEffect( cgs.effects.bowPowerupShotEffect, cent->lerpOrigin, forward ); } theFxScheduler.PlayEffect( cgs.effects.bowShotEffect, cent->lerpOrigin, forward ); } void FX_HowlerAltProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ) { vec3_t forward; if ( VectorNormalize2( cent->gent->s.pos.trDelta, forward ) == 0.0f ) { if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f ) { forward[2] = 1.0f; } } // hack the scale of the forward vector if we were just fired or bounced...this will shorten up the tail for a split second so tails don't clip so harshly int dif = cg.time - cent->gent->s.pos.trTime; if ( dif < 75 ) { if ( dif < 0 ) { dif = 0; } float scale = ( dif / 75.0f ) * 0.95f + 0.05f; VectorScale( forward, scale, forward ); } // see if we have some sort of extra charge going on for ( int t = 1; t < cent->gent->count; t++ ) { // just add ourselves over, and over, and over when we are charged theFxScheduler.PlayEffect( cgs.effects.howlerPowerupShotEffect, cent->lerpOrigin, forward ); } theFxScheduler.PlayEffect( cgs.effects.howlerShotEffect, cent->lerpOrigin, forward ); } /* ------------------------- FX_BryarAltHitWall ------------------------- */ void FX_BryarAltHitWall( vec3_t origin, vec3_t normal, int power ) { switch( power ) { case 4: case 5: theFxScheduler.PlayEffect( cgs.effects.bryarWallImpactEffect3, origin, normal ); break; case 2: case 3: theFxScheduler.PlayEffect( cgs.effects.bryarWallImpactEffect2, origin, normal ); break; default: theFxScheduler.PlayEffect( cgs.effects.bryarWallImpactEffect, origin, normal ); break; } } void FX_BowAltHitWall( vec3_t origin, vec3_t normal, int power ) { switch( power ) { case 4: case 5: theFxScheduler.PlayEffect( cgs.effects.bowWallImpactEffect3, origin, normal ); break; case 2: case 3: theFxScheduler.PlayEffect( cgs.effects.bowWallImpactEffect2, origin, normal ); break; default: theFxScheduler.PlayEffect( cgs.effects.bowWallImpactEffect, origin, normal ); break; } } void FX_HowlerAltHitWall( vec3_t origin, vec3_t normal, int power ) { switch( power ) { case 4: case 5: theFxScheduler.PlayEffect( cgs.effects.howlerWallImpactEffect3, origin, normal ); break; case 2: case 3: theFxScheduler.PlayEffect( cgs.effects.howlerWallImpactEffect2, origin, normal ); break; default: theFxScheduler.PlayEffect( cgs.effects.howlerWallImpactEffect, origin, normal ); break; } } /* ------------------------- FX_BryarAltHitPlayer ------------------------- */ void FX_BryarAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ) { theFxScheduler.PlayEffect( cgs.effects.bryarFleshImpactEffect, origin, normal ); } void FX_BowAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ) { theFxScheduler.PlayEffect( cgs.effects.bowFleshImpactEffect, origin, normal ); } void FX_HowlerAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ) { theFxScheduler.PlayEffect( cgs.effects.howlerFleshImpactEffect, origin, normal ); } Build the SP client and exe of OPENJKit, and that's all.
I think this should be useful also for understand how to add a new weapon into SP game, because is missing a tutorial about that. the difference i suppose it's that you need to add the new weapons definition, the function for making it usable by player and NPCs and for add it into ammo and items, and the functions and the functions about how the weapons works for projectiles and impacts. i am not so expert about this tecnique part but this work for visual efx of weapons like BLASTER_PISTOLS.
i hope this can help someone.
-
Asgarath83's post in Noghri stick crash was marked as the answer
Lolling! Was the "Immunetogas" field, of g_combat.cpp i add some no-droid exceptions XD noghri stick fixed.
-
Asgarath83's post in Max_Original_Edges was marked as the answer
Fixed, i deleted a large amount of patches and structural meshes.
-
Asgarath83's post in Face Rigging was marked as the answer
Use Cranium for all head, cervical for nek, 50-50 cervical cranium in the cranium - cervical vertex junction,
leye and reye for eyes for orbiculars, these control the eyes blinks animation and the face_dead closed eyes.
the jaw bone, for the lower jaw and lower teeth 50-50 cranium \ jaw for the edges of the lips and the junction between upper and lower jaw. this control the mouth open and close into the talking.
ceyebrows for the front rig for eyebrows of face_frown face_aux animation
it's pretty intuitive, the pricipal bones are that and they affected exactly like the bones of human head.
that's all
-
Asgarath83's post in Error Max_Map_Draw_Verts was marked as the answer
Oh... i fixed, i need just to remove some misc_,model entities... really i am near the limitation of geometry of radiant... :\
i hope i can clip all models :\