Asgarath83 Posted October 3, 2015 Share Posted October 3, 2015 Hello to all! I am trying to learning how to add a new weapon into the game.because there isn't again a tutorial about add a weapon into single player, i decided to begin to learn that about the multiplayer. i have followed the @@eezstreet tutorialhttp://jkhub.org/tutorials/article/131-how-to-create-a-new-weapon-mp/ here.very useful. useful also the @ burst repeater repository code. together, tutorial and that help me very much to understood the basic of this hard work. after an evening of strong coding work, i end all without any single error of building. also SP and MP game works fine...my new weapon is called "bloodgun"(WP_BLOODGUN). and act simply as another bryar \ blaster pistol.my issue is that: on SP game, i haven't again managed good how this stuff work because something are missing (some parameter are moved into weapons.dat) and some other stuff is not on the corrispondent MP files of the SP code. so find the correct part of the code to edit with SP is little hard.so i am trying the weapon on multiplayer in a solo match capture the flag.well. what is my problem?simply...i cannot use the cheats command "give all" or give weapon_bloodgun for try and use the weapon. D:so i really not know how can use it on multiplayer game.why that? becausewhen i type devmapallconsolle tell to me:"can't find map /*bsp"when i type helpusobi 1it tell me "unknown command helpusobi 1"i am using the pure openjk.x86 multiplayer exe .so how can i see my new weapon?on SP server consolle commands works fine.thanks for any answer Link to comment
Ramikad Posted October 3, 2015 Share Posted October 3, 2015 when i type devmapallconsolle tell to me:"can't find map /*bsp"when i type helpusobi 1it tell me "unknown command helpusobi 1"i am using the pure openjk.x86 multiplayer exe . The error message is telling you what to do: just type /devmapall <mapname>. I remember it worked differently in the past and especially in SP, you could just /devmapall or /helpusobi 1, but that's changed. As far as I know /helpusobi 1 doesn't work in multiplayer - you can only /devmapall <mapname>. Asgarath83 likes this Link to comment
Asgarath83 Posted October 3, 2015 Author Share Posted October 3, 2015 The error message is telling you what to do: just type /devmapall <mapname>. I remember it worked differently in the past and especially in SP, you could just /devmapall or /helpusobi 1, but that's changed. As far as I know /helpusobi 1 doesn't work in multiplayer - you can only /devmapall <mapname>. Oh... And so how can i test my new weapon? D:sure i cannot put as a map item.also i cannot equip Bots with that... so i am forced to learn how this can work into Single player o.oit's not easy, many things are differents (only the fx_ file parts is pretty similar.)and there are a dozens of files of the code that should be edited for working a weapons.basically, if someone want help me a lot, i need simply to know where i can find into the SP code the equivalent of these functions, i mean, simply a list of the files i need to look for find this functions, nothing more. i want do this by my self, all what i am asking about coding part is just a little help about how to locate that parts of code and some suggest about how can i test the weapon with player and NPC in the SP game: https://github.com/srcanseco/JKCup/commit/4721050089fb9b1bc43fcd44a3fa86659912ee2d so my questions are two:1 the testing problem:if i use "give all"player get: saber, blaster_pistol, disruptor, blaster, bowcaster, demp2, repeater, flechette, concussion, rocket launcher, thermal, tripmine and detpack.how can i put into SP code the function for add the new weapon to this list? so i can try and debug it? D: 2: location of code part related to weapons into SP.for example: bg_weapons.c weapons definitions, into SP are into weapons.hthere is not the equivalent of cg_weaponinit.c (i suppose weapons.dat contain the information stored into bg_weapons.c )and i am a lot confused about the /quaked function o.oabout MOD (mean of death) and efx and sound definition instead, i can manage it because i have already edited in past and i know a lot better this chunk of code..my confusion is about how to insert a weapon into the weapon roll list selectable mnu of the player for try and debug it. o.o Link to comment
Asgarath83 Posted October 4, 2015 Author Share Posted October 4, 2015 The error message is telling you what to do: just type /devmapall <mapname>. I remember it worked differently in the past and especially in SP, you could just /devmapall or /helpusobi 1, but that's changed. As far as I know /helpusobi 1 doesn't work in multiplayer - you can only /devmapall <mapname>. solved after a lock on helpusobi 1 into the code... i see is allowed in the server of map loaded with devmap command.so i load with devmap mp/ctf1 for loading a map with cheats enabled and i set "give all" also i tryed "give weapon_bloodgun"but nothing... there is not the weapon into the weapon slide hud. shuold be before bryar pistol, instead there's not.so i cannot see and test it. years ago there was on filefront a MP mod called dark forces that add various Weapon to MP code. there is noone that have the source code of dark forces mod? really i desire to study it. found it http://mrwonko.de/jk3files/Jedi%20Academy/Mods/Multiplayer/67030/ Link to comment
Asgarath83 Posted October 4, 2015 Author Share Posted October 4, 2015 i tryed this: http://jkhub.org/tutorials/article/133-make-any-weapon-usable-from-a-swoop-mpsp/ works pretty well on MP, but also if i added ad entry for new weapon player not use it.instead, on SP not work (but i suppose is okay: new weapon is not again coded on SP) :\maybe switch weapon function is the key. qboolean PM_WeaponOkOnVehicle( int weapon ) { //FIXME: check g_vehicleInfo for our vehicle? switch ( weapon ) { //case WP_NONE: case WP_MELEE: case WP_SABER: case WP_BRYAR_PISTOL: case WP_BLASTER: case WP_DISRUPTOR: case WP_BOWCASTER: case WP_REPEATER: case WP_DEMP2: case WP_FLECHETTE: case WP_CONCUSSION: case WP_ROCKET_LAUNCHER: case WP_THERMAL: case WP_TRIP_MINE: case WP_DET_PACK: case WP_BLOODGUN: //case WP_THERMAL: return qtrue; break; } return qfalse; } works fine, but after the weapon detpack... ROTFL, also new weapon... model is not displayed and player launch detpack projectiles XD @@eezstreet@@ensiform@@ent@@Ramikad : please, someone can give me a little help?how can i add my new weapon as usable by player into MP code?and do you know where are stored this data into SP code?https://github.com/srcanseco/JKCup/commit/4721050089fb9b1bc43fcd44a3fa86659912ee2d Link to comment
Tempust85 Posted October 4, 2015 Share Posted October 4, 2015 Pick a similar behaving weapon from base JKA and clone it. Then once you can load the new weapon ingame, go about changing it to suit what you want. I did this for the Gamorrean Axe in DF2 Mod. Asgarath83 likes this Link to comment
Asgarath83 Posted October 4, 2015 Author Share Posted October 4, 2015 Pick a similar behaving weapon from base JKA and clone it. Then once you can load the new weapon ingame, go about changing it to suit what you want. I did this for the Gamorrean Axe in DF2 Mod. yes, i am trying to doing exactly something like this. i simply want to clone into new four weapons the flechette, the bryar pistol, the concussion and the demp2. i am starting with bryar because i think is the more easy to understand, but i at cause of difference by SP and MP code, i am not much sure about the part of code i need to edit, also for allow NPCs to equip the weapon and for allow player to obtain the weapon by npc deads or with the code "give all" my trouble is simply this. also on Multiplayer, also if have replied exactly the code staff of burst repeater linked up into the thread (but the related code of bryar pistol, not of repeater) and the eezstreet tutorial, new weapon not working :\ if you have done some weapon for SP code, @@DT85 you can tell me which files of SP code i need to edit respect to MP? where are the main difference?example: weapon definition in multiplayer is in BG_weapons.h in single player the equivalent code is in weapons.h. is this kind of thing that is stunning me. :\ Link to comment
Asgarath83 Posted October 4, 2015 Author Share Posted October 4, 2015 I have tryed to edit this files EDIT FILE LISTCg_weapons.cG_weapons.cBg_pmove.cBg_weapons.cBg_weapons.hW_local.hCg_local.hG_log.cG_combat.cBg_misc.cBg_public.hBg_saga.cCg_event.cCg_local.hCg_weaponinit.cCg_weapons.cFx_bryarpistol.cFx_local.hG_weapon.cCommon/Q_shaded.h with this example:https://github.com/srcanseco/JKCup/commit/4721050089fb9b1bc43fcd44a3fa86659912ee2di have not obtained much success, so i ask a little help and suggest about code weapon. sorry for disturb, and thanks for every answer.what i simply want to know is: on SP the information stored on this files, in which files are allocated? i wanna know exactly what points of the code i need to edit for making a new working weapon slot into single player, for player and for NPCs.i not want a complete guide about it because i want to learn to myself, i need just some hints about the code parts i need to edit.thanks to all. Link to comment
ent Posted October 4, 2015 Share Posted October 4, 2015 You have to make both client and server mod. Link to comment
Asgarath83 Posted October 4, 2015 Author Share Posted October 4, 2015 You have to make both client and server mod.so, what i put in cgame code files, i need to put also in game folder's files code?cgame -> client server folder . (specific player settings.)game -> server folder (global game settings)well, is a good begin.if i will got success to add a functionally weapon in SP i hope to write some tutorial about the procedure. for moment, i am again learning. thanks @@ent Link to comment
ent Posted October 4, 2015 Share Posted October 4, 2015 And pack cgame module into a pk3 file. Link to comment
Asgarath83 Posted October 5, 2015 Author Share Posted October 5, 2015 And pack cgame module into a pk3 file. so game folder create the openjk_sp.x86 and cgame create the ja.dll of single player. understood i need to put the dll into a pk3 file inside the mod. thanks. Link to comment
ent Posted October 5, 2015 Share Posted October 5, 2015 If it is a sp mod then not sure about packing. I only talk about mp. Link to comment
Asgarath83 Posted October 5, 2015 Author Share Posted October 5, 2015 If it is a sp mod then not sure about packing. I only talk about mp.I used mp code for learning because tutorials and examples are only for MP code but my very desire is to create weapons on SP.otherwise, today i have edited the HUD part of switching weapons.i editedthe code part of give all cheat for allow player to get ALL weapons of SP, not only the player weapons.also, i have edited the functions of previous and next weapons (and relative datapad functions) for allow player to use it.this is the edited code part in cg_weapons.cpp /* =============== CG_NextWeapon_f =============== */ void CG_NextWeapon_f( void ) { int i; int original; if ( !cg.snap ) { return; } /* if ( cg.snap->ps.pm_flags & PMF_FOLLOW ) { return; } */ if( g_entities[0].flags & FL_LOCK_PLAYER_WEAPONS ) { CG_PlayerLockedWeaponSpeech( qfalse ); return; } if( g_entities[0].client && g_entities[0].client->NPC_class == CLASS_ATST ) { CG_ToggleATSTWeapon(); return; } if ( cg.snap->ps.eFlags & EF_LOCKED_TO_WEAPON ) { // can't do any sort of weapon switching when in the emplaced gun return; } if ( cg.snap->ps.viewEntity ) { // yeah, probably need a better check here if ( g_entities[cg.snap->ps.viewEntity].client && ( g_entities[cg.snap->ps.viewEntity].client->NPC_class == CLASS_R5D2 || g_entities[cg.snap->ps.viewEntity].client->NPC_class == CLASS_R2D2 || g_entities[cg.snap->ps.viewEntity].client->NPC_class == CLASS_MOUSE )) { return; } } original = cg.weaponSelect; int firstWeapon = FIRST_WEAPON; if (G_IsRidingVehicle(&g_entities[cg.snap->ps.viewEntity])) { firstWeapon = 0; // include WP_NONE here } for ( i = 0 ; i <= MAX_PLAYER_WEAPONS ; i++ ) { //*SIGH*... Hack to put concussion rifle before rocketlauncher if ( cg.weaponSelect == WP_FLECHETTE ) { cg.weaponSelect = WP_CONCUSSION; } else if ( cg.weaponSelect == WP_CONCUSSION ) { cg.weaponSelect = WP_ROCKET_LAUNCHER; } else if ( cg.weaponSelect == WP_DET_PACK ) { cg.weaponSelect = WP_MELEE; } else if ( cg.weaponSelect == WP_MELEE ) { cg.weaponSelect = WP_BRYAR_PISTOL; } else if ( cg.weaponSelect == WP_BRYAR_PISTOL ) { cg.weaponSelect = WP_ATST_MAIN; } else if ( cg.weaponSelect == WP_ATST_MAIN ) { cg.weaponSelect = WP_ATST_SIDE; } else if ( cg.weaponSelect == WP_ATST_SIDE ) { cg.weaponSelect = WP_TUSKEN_RIFLE; } else if ( cg.weaponSelect == WP_TUSKEN_RIFLE ) { cg.weaponSelect = WP_TUSKEN_STAFF; } else if ( cg.weaponSelect == WP_TUSKEN_STAFF ) { cg.weaponSelect = WP_BLOODGUN; } else if ( cg.weaponSelect == WP_BLOODGUN ) { cg.weaponSelect = WP_CANNON; } else if ( cg.weaponSelect == WP_CANNON ) { cg.weaponSelect = WP_SONIC; } else if ( cg.weaponSelect == WP_SONIC ) { cg.weaponSelect = WP_POISON; } else if ( cg.weaponSelect == WP_POISON ) { cg.weaponSelect = firstWeapon; } else { cg.weaponSelect++; } if ( cg.weaponSelect < firstWeapon || cg.weaponSelect > MAX_PLAYER_WEAPONS) { cg.weaponSelect = firstWeapon; } if ( CG_WeaponSelectable( cg.weaponSelect, original, qfalse ) ) { // cg.weaponSelectTime = cg.time; SetWeaponSelectTime(); return; } } cg.weaponSelect = original; } /* =============== CG_DPNextWeapon_f =============== */ void CG_DPNextWeapon_f( void ) { int i; int original; if ( !cg.snap ) { return; } /* if ( cg.snap->ps.pm_flags & PMF_FOLLOW ) { return; } */ original = cg.DataPadWeaponSelect; for ( i = 0 ; i <= MAX_PLAYER_WEAPONS ; i++ ) { //*SIGH*... Hack to put concussion rifle before rocketlauncher if ( cg.DataPadWeaponSelect == WP_FLECHETTE ) { cg.DataPadWeaponSelect = WP_CONCUSSION; } else if ( cg.DataPadWeaponSelect == WP_CONCUSSION ) { cg.DataPadWeaponSelect = WP_ROCKET_LAUNCHER; } else if ( cg.DataPadWeaponSelect == WP_DET_PACK ) { cg.DataPadWeaponSelect = WP_MELEE; } else if ( cg.DataPadWeaponSelect == WP_MELEE ) { cg.DataPadWeaponSelect = WP_BRYAR_PISTOL; } else if ( cg.DataPadWeaponSelect == WP_BRYAR_PISTOL ) { cg.DataPadWeaponSelect = WP_ATST_MAIN; } else if ( cg.DataPadWeaponSelect == WP_ATST_MAIN ) { cg.DataPadWeaponSelect = WP_ATST_SIDE; } else if ( cg.DataPadWeaponSelect == WP_ATST_SIDE ) { cg.DataPadWeaponSelect = WP_TUSKEN_RIFLE; } else if ( cg.DataPadWeaponSelect == WP_TUSKEN_RIFLE ) { cg.DataPadWeaponSelect = WP_TUSKEN_STAFF; } else if ( cg.DataPadWeaponSelect == WP_TUSKEN_STAFF ) { cg.DataPadWeaponSelect = WP_BLOODGUN; } else if ( cg.DataPadWeaponSelect == WP_BLOODGUN ) { cg.DataPadWeaponSelect = WP_CANNON; } else if ( cg.DataPadWeaponSelect == WP_CANNON ) { cg.DataPadWeaponSelect = WP_SONIC; } else if ( cg.DataPadWeaponSelect == WP_SONIC ) { cg.DataPadWeaponSelect = WP_POISON; } else if ( cg.DataPadWeaponSelect == WP_POISON ) { cg.DataPadWeaponSelect = FIRST_WEAPON; } else { cg.DataPadWeaponSelect++; } if ( cg.DataPadWeaponSelect < FIRST_WEAPON || cg.DataPadWeaponSelect > MAX_PLAYER_WEAPONS) { cg.DataPadWeaponSelect = FIRST_WEAPON; } if ( CG_WeaponSelectable( cg.DataPadWeaponSelect, original, qtrue ) ) { return; } } cg.DataPadWeaponSelect = original; } /* =============== CG_DPPrevWeapon_f =============== */ void CG_DPPrevWeapon_f( void ) { int i; int original; if ( !cg.snap ) { return; } /* if ( cg.snap->ps.pm_flags & PMF_FOLLOW ) { return; } */ original = cg.DataPadWeaponSelect; for ( i = 0 ; i <= MAX_PLAYER_WEAPONS ; i++ ) { //*SIGH*... Hack to put concussion rifle before rocketlauncher if ( cg.DataPadWeaponSelect == WP_ROCKET_LAUNCHER ) { cg.DataPadWeaponSelect = WP_CONCUSSION; } else if ( cg.DataPadWeaponSelect == WP_CONCUSSION ) { cg.DataPadWeaponSelect = WP_FLECHETTE; } else if ( cg.DataPadWeaponSelect == WP_MELEE ) { cg.DataPadWeaponSelect = WP_DET_PACK; } else if ( cg.DataPadWeaponSelect == WP_BRYAR_PISTOL ) { cg.DataPadWeaponSelect = WP_MELEE; } else if ( cg.DataPadWeaponSelect == WP_ATST_MAIN ) { cg.DataPadWeaponSelect = WP_BRYAR_PISTOL; } else if ( cg.DataPadWeaponSelect == WP_ATST_SIDE ) { cg.DataPadWeaponSelect = WP_ATST_MAIN; } else if ( cg.DataPadWeaponSelect == WP_TUSKEN_RIFLE ) { cg.DataPadWeaponSelect = WP_ATST_SIDE; } else if ( cg.DataPadWeaponSelect == WP_TUSKEN_STAFF ) { cg.DataPadWeaponSelect = WP_TUSKEN_RIFLE; } else if ( cg.DataPadWeaponSelect == WP_BLOODGUN ) { cg.DataPadWeaponSelect = WP_TUSKEN_STAFF; } else if ( cg.DataPadWeaponSelect == WP_CANNON ) { cg.DataPadWeaponSelect = WP_BLOODGUN; } else if ( cg.DataPadWeaponSelect == WP_SONIC ) { cg.DataPadWeaponSelect = WP_CANNON; } else if ( cg.DataPadWeaponSelect == WP_POISON ) { cg.DataPadWeaponSelect = WP_SONIC; } else { cg.DataPadWeaponSelect--; } if ( cg.DataPadWeaponSelect < FIRST_WEAPON || cg.DataPadWeaponSelect > MAX_PLAYER_WEAPONS) { cg.DataPadWeaponSelect = MAX_PLAYER_WEAPONS; } if ( CG_WeaponSelectable( cg.DataPadWeaponSelect, original, qtrue ) ) { return; } } cg.DataPadWeaponSelect = original; } /* =============== CG_PrevWeapon_f =============== */ void CG_PrevWeapon_f( void ) { int i; int original; if ( !cg.snap ) { return; } /* if ( cg.snap->ps.pm_flags & PMF_FOLLOW ) { return; } */ if( g_entities[0].flags & FL_LOCK_PLAYER_WEAPONS ) { CG_PlayerLockedWeaponSpeech( qfalse ); return; } if( g_entities[0].client && g_entities[0].client->NPC_class == CLASS_ATST ) { CG_ToggleATSTWeapon(); return; } if ( cg.snap->ps.eFlags & EF_LOCKED_TO_WEAPON ) { // can't do any sort of weapon switching when in the emplaced gun return; } if ( cg.snap->ps.viewEntity ) { // yeah, probably need a better check here if ( g_entities[cg.snap->ps.viewEntity].client && ( g_entities[cg.snap->ps.viewEntity].client->NPC_class == CLASS_R5D2 || g_entities[cg.snap->ps.viewEntity].client->NPC_class == CLASS_R2D2 || g_entities[cg.snap->ps.viewEntity].client->NPC_class == CLASS_MOUSE )) { return; } } original = cg.weaponSelect; int firstWeapon = FIRST_WEAPON; if (G_IsRidingVehicle(&g_entities[cg.snap->ps.viewEntity])) { firstWeapon = 0; // include WP_NONE here } for ( i = 0 ; i <= MAX_PLAYER_WEAPONS ; i++ ) { //*SIGH*... Hack to put concussion rifle before rocketlauncher if ( cg.weaponSelect == WP_ROCKET_LAUNCHER ) { cg.weaponSelect = WP_CONCUSSION; } else if ( cg.weaponSelect == WP_CONCUSSION ) { cg.weaponSelect = WP_FLECHETTE; } else if ( cg.weaponSelect == WP_MELEE ) { cg.weaponSelect = WP_DET_PACK; } else if ( cg.weaponSelect == WP_BRYAR_PISTOL ) { cg.weaponSelect = WP_MELEE; } else if ( cg.weaponSelect == WP_ATST_MAIN ) { cg.weaponSelect = WP_BRYAR_PISTOL; } else if ( cg.weaponSelect == WP_ATST_SIDE ) { cg.weaponSelect = WP_ATST_MAIN; } else if ( cg.weaponSelect == WP_TUSKEN_RIFLE ) { cg.weaponSelect = WP_ATST_SIDE; } else if ( cg.weaponSelect == WP_TUSKEN_STAFF ) { cg.weaponSelect = WP_TUSKEN_RIFLE; } else if ( cg.weaponSelect == WP_BLOODGUN ) { cg.weaponSelect = WP_TUSKEN_STAFF; } else if ( cg.weaponSelect == WP_CANNON ) { cg.weaponSelect = WP_BLOODGUN; } else if ( cg.weaponSelect == WP_SONIC ) { cg.weaponSelect = WP_CANNON; } else if ( cg.weaponSelect == WP_POISON ) { cg.weaponSelect = WP_SONIC; } else { cg.weaponSelect--; } if ( cg.weaponSelect < firstWeapon || cg.weaponSelect > MAX_PLAYER_WEAPONS) { cg.weaponSelect = MAX_PLAYER_WEAPONS; } if ( CG_WeaponSelectable( cg.weaponSelect, original, qfalse ) ) { SetWeaponSelectTime(); // cg.weaponSelectTime = cg.time; return; } } cg.weaponSelect = original; } works like a charm!i havent' put the noghri stick because it crash.some note about weapons:- Weapon Atst_Side: efx are not displayed and it not make damage shooted by player, so i think i will removed it.- Weapon Tusken_staff : working good but player cannot dmg NPCs with tusken staff, so i think i will remove also it by usable weapons.- i will add the stun baton, instead.- the new weapons: WP_BLOODGUN (act exactly like a bryar pistol) is not again coded so when i switch to this the map crash and show me the message of edit items.dat file because bloodgun have a missing item.weapons cannon, sonic, poison: they against not works. (obvious, i not again coded it.) switch this 3 weapon immediatly crash the game.well, otherwise know i am in condition to test the weaponsmy next step is to remove unuseful weapon like atst_side and tusken_staff by player use, add the stun baton (not sure about noghri stick? it crash if used by player right? so is not a good idea add it on give all cheat...)at this poin i will start to coding the WP_bloodgun. Link to comment
Asgarath83 Posted October 5, 2015 Author Share Posted October 5, 2015 there is some error in datapad code scroll up. i am fixing. Link to comment
Asgarath83 Posted October 5, 2015 Author Share Posted October 5, 2015 weapon switching fixed. but it crash when it try to return by last weapon selectable and equiped to the lightsaber or, by lightsaber to last weapons equiped. for the rest is fine. i will need to works a lot more on this.and to make the code of other SP weapons. lol. (that's is the hardest part o.o )for the moment i can switch all weapons into HUD and i added into code/ weapons.h the entry of the new 4 weapons. typedef enum //# weapon_e { WP_NONE, // Player weapons WP_SABER, // player and NPC weapon WP_BLASTER_PISTOL, // player and NPC weapon WP_BLASTER, // player and NPC weapon WP_DISRUPTOR, // player and NPC weapon WP_BOWCASTER, // NPC weapon - player can pick this up, but never starts with them WP_REPEATER, // NPC weapon - player can pick this up, but never starts with them WP_DEMP2, // NPC weapon - player can pick this up, but never starts with them WP_FLECHETTE, // NPC weapon - player can pick this up, but never starts with them WP_ROCKET_LAUNCHER, // NPC weapon - player can pick this up, but never starts with them WP_THERMAL, // player and NPC weapon WP_TRIP_MINE, // NPC weapon - player can pick this up, but never starts with them WP_DET_PACK, // NPC weapon - player can pick this up, but never starts with them WP_CONCUSSION, // NPC weapon - player can pick this up, but never starts with them //extras WP_MELEE, // player and NPC weapon - Any ol' melee attack //when in atst WP_ATST_MAIN, WP_ATST_SIDE, // These can never be gotten directly by the player WP_STUN_BATON, // stupid weapon, should remove //NPC weapons WP_BRYAR_PISTOL, // NPC weapon - player can pick this up, but never starts with them WP_EMPLACED_GUN, WP_BOT_LASER, // Probe droid - Laser blast WP_TURRET, // turret guns WP_TIE_FIGHTER, WP_RAPID_FIRE_CONC, WP_JAWA, WP_TUSKEN_RIFLE, WP_TUSKEN_STAFF, WP_SCEPTER, WP_NOGHRI_STICK, WP_BLOODGUN, WP_CANNON, WP_SONIC, WP_POISON, //# #eol WP_NUM_WEAPONS also, i edited the MAX_WEAPONS parameter into common/q_shared by 28 to 32. Link to comment
Asgarath83 Posted October 5, 2015 Author Share Posted October 5, 2015 searching about a only SP weapon like the tusken_rifle into Openjk solution i found the list of the files needs to be edited on SP for add a new weapons. i paste here the informations. i hope someone can find it useful. common\q_shared <- for edit max_weapons to 32weapons.h (define weapon enum list)cg_weapons.cpp (weapons setting for player, like Hud switchin etc)q3_interface (add weapons supports for Npc files, icarus etc. )bg_pmove and bg_panimate.cpp: stuff related animation of shooting and standing of the weapon.g_combat.cpp: weapons fightning parameters.g_itemload.cpp and g_items.h (loading MD3 weapons parameters and also item of weapons staff for Items.dat external data.g_weaponload.cpp (not again sure but i think is the code about equipping and using a weapon)npc.cpp: weapons parms related to npcs.npc_combat.cpp : how npcs use determinate weapons in determinate conditions.wp_"nameofweapon".cpp define the behavour of the weapons : vectors, shooting, explosions etc.fx_"namedofweapon.cpp" define the efx of projectiles of the weapons, explosions, sounds of efx etc.g_missile.cpp : vectors for projectileswp_saber.cpp : importat for interation between weapon and saber: (shoots can be parryed \ deflected by saber?)npc_spawn.cpp: condition of weapon about npc spawningg_functions.h : list of some special function of weapons.g_functions.cpp : programming of some special functions of weapons.ai_sniper.cpp \ ai_tusken \ ai_jedi \ ai_stormtrooper and it's possible also, some other ai files": some weapons need a coding part about the NPCs that use it. for example: tusken rifle get some special parameter into ai_sniper and ai_tusken file. well, i think that's all as a point of starting. new coming the true challenge! Link to comment
ensiform Posted October 6, 2015 Share Posted October 6, 2015 I would caution against changing the maximum number of things in Single Player or adding things to some structures. This time may not affect things, but it is possible you might break save files doing so in the future In a perfect world everything under the sun would be nicely customizable by mods/script files but its not unfortunately. Asgarath83 likes this Link to comment
Asgarath83 Posted October 6, 2015 Author Share Posted October 6, 2015 I would caution against changing the maximum number of things in Single Player or adding things to some structures. This time may not affect things, but it is possible you might break save files doing so in the future In a perfect world everything under the sun would be nicely customizable by mods/script files but its not unfortunately. Eh, pity JkA not work as skyrim when scripts can add all spells or weapon one desire... in JKA weapons and force powers are hardcoded. if there was a version of openjk that use a weapon.dat and a force.dat extended that allow to add new weapons without any trouble or code hacking sure i will use it. but is not the case. ._.however not, i not want to change any variable of the game. i will simply add the new entries for the new weapons. nothing more, nothing less. i will not edit bryar, concussion, flechette and demp2 code in any of they parts. the unique part i edited in these codes concerned the MOD like demp2 dmg increased on droids, i making dmg increased or reduced of the weapons against the classes of AI. that's because like langerd i am doing a fantasy mod, and i wanna add a RPG factor with elemental strenght and weakness tothe opponents.what i wanna do is simply to study bryar, flechette, concussion and demp2 code for add 4 new weapons that act exactly like this into SP. same dinamics, same physic, only 4 new weapons slot, 4 new weapon model and relative efx and sounds. Link to comment
Asgarath83 Posted October 6, 2015 Author Share Posted October 6, 2015 I would caution against changing the maximum number of things in Single Player or adding things to some structures. This time may not affect things, but it is possible you might break save files doing so in the future In a perfect world everything under the sun would be nicely customizable by mods/script files but its not unfortunately.there was also a dark force mod for multiplayer that adds new weapons to MP, should be really interessing studying its code... but i cannot because there are only the .DLL and is not possible to recreate a code loading a DLL with visual studio. and after 10 years sure authors of mod are not contactable and will not share the source code of the dark forces MP mod with me for study about the new weapons. was this mod: http://mrwonko.de/jk3files/Jedi%20Academy/Mods/Multiplayer/67030/ Link to comment
ensiform Posted October 6, 2015 Share Posted October 6, 2015 Adding weapons to MP isn't that difficult but it would not work the same way in SP due to save breakage in the binary not just mod AFAIK. Link to comment
Asgarath83 Posted October 6, 2015 Author Share Posted October 6, 2015 Adding weapons to MP isn't that difficult but it would not work the same way in SP due to save breakage in the binary not just mod AFAIK.yes i know files and contains are pretty different. emmm what about save brekeage? you mean savegame not working more? or you mean that old saves are unavailable with code edit? i know that, but is not a good trouble. i simply use devmap command for load the test map, spawn some enemy and test the weapons. Link to comment
Asgarath83 Posted October 6, 2015 Author Share Posted October 6, 2015 @@ensiformGreat progress! after 3 days of strong works all weapons are loaded into the slide with give all cheats, included the new 4 weapons.Bug i need to fix:1 - the first weapons not shooting nothing. no efx, no snd, no dmg against npcs. i need really to work a lot about this.also should work as bryar pistol. weapon not make charging shoots.2 - animation of the second new weapon is wrong, but i know to fix it. also this weapon not shoot nothing. this weapons should act like tyson flechette3 - the third weapons also no efx, no dmg, no snd. this weapons should act like concussion rifle. against nothing. 4 - the last weapon need to act like Demp2 but not working much. also, it ever istantly crash the game. now i will fix the first tree weapons, for the forth i will see at the end when i got more confidence about this process. Archangel35757 likes this Link to comment
Asgarath83 Posted October 7, 2015 Author Share Posted October 7, 2015 I remember @@JediBantha for a dark forces mod create a new SP weapon into the thread from concussion to destruction. i remember is weapon not shoot nothing at the start of works and he needs a lot of time for fix it. i wanna ready is thread. maybe there is a suggestion for fix my weapons. i think i got the same his problem. Link to comment
Asgarath83 Posted October 7, 2015 Author Share Posted October 7, 2015 @@ensiform @@ent did it! need just a fix on efx and Npc support and class damage and the first of my four weapons works perfectly! it did also altcharge atk! and now second weapon... 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