-
Posts
2,023 -
Joined
-
Last visited
Content Type
Profiles
News Articles
Tutorials
Forums
Downloads
Everything posted by Asgarath83
-
Is pretty easy to do that: You need just cmake, openjk and visual studio 2010 -2012. istall visual studio, build a solution with cmake and edit this field into NPC_stats.cpp change that: #define MAX_NPC_DATA_SIZE 0x40000 // into #define MAX_NPC_DATA_SIZE 0x80000 // original is 0x40000 after that, make a Release build of Openjk exe and jagamex86.dll with batch build process and you got it!. However, i had tryied many years ago original KOTF. i liked the idea, but i was disappointed about "malware" and missing of a SP campaign with a rebuild of the movie adventures. so i am very happy you're doing this project. i cannot help for UI interface but about NPCs that's all you need. there was however an old mod with a nice SP menu with character and saber descrition and creation called escape from yavin 4. maybe if you download and check the ui files you can get the answer about how to configure a nice SP menu. ey4 is a very old mod and it not have any code attempt on SP. but personally i tryied amazing.
-
STAR WARS: Movie Duels (Remaster of Movie Duels II)
Asgarath83 replied to General Howard's topic in WIPs, Teasers & Releases
Simply extract dms.dat by ext_data of assets1.pk3 on base folder, copy and paste into ext_data folder of mod and edit with notepad. this will rewrite also in the mod the original dms.dat. you need to understand that: many time modding, is just overwritting the same file of the original assets into your mod assets. if you do an identic file, identic path, identic name into your mod, it overwrite the original. for example. if you put inside your mod a sound/weapons/force/heal.mp3 new file, this will change in game the heal sound for all jedi and all npc that use heal power. -
STAR WARS: Movie Duels (Remaster of Movie Duels II)
Asgarath83 replied to General Howard's topic in WIPs, Teasers & Releases
Maybe later, pa Maybe later, pal. these week i need to make a hospital recover for fix some my heal trouble that are leaving me crazy. -.- italy sanity system sucks. i not know how many time i need or for how many time i'll disappear. however you can edit dms.dat file on ext_data folder with notepad and add dinamyc soundtrack entry for your music. after you do that, all you needis to slap in music folder, a mp3 stereo sampled at 44100 hertz of an action theme, an explore theme, and a lot of other little file for transition between action and explore. you can check original game files for understand how that works. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
mmm... one of the more painful thing for me is mapping but just because i am very bad with bruish creation. i am much more good to make terrains with easygen or to using MD3 models for making building, rooms and prefabs. the trouble of MD3 is that solid spawnflag on radiant cast an absurb amount of collision triangle. map building time so become eternal, fps drop in game, and also obvious, the trouble that gtkradiant cannot contain more of 32k or 64k vertexes of polygon, now i not remember exactly. so using LOD on MD3 models of building on map should be really a genial idea! D: a very lower LOD model maybe can be clipped with solid spawnflag and generate a simple collider primitives, without become crazy myself to manually clip every damned map objects. for models, i not know any way for dissolve or reduce vertex and edge amount on max, but is possible to do on blender with the newest edition. i not talk about decimate tool. decimate tool destroy uvmapping. there is another tool on blender that can decimate poly count of object (so doing lods ) without destroy uvmapping. the biggest trouble of decimating vertex is the uvmapping collapsing. >.< about LOD, mmm i remember into psykopath old site was some tutorial about modelling a GLM model with lod support. i will need to check the thing when i get a lot of time. Thanks for answer. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
Well, at moment i am using 3d max. and yes, i know how to splits models geometry into max and bleneder. ever do that. just i was wondering if there was another more simple way. nothing else. however... i hope someone can answer me to the other thread about ECM because i am stuck in a compiling trouble. >.< -
Hello, i am working on code of ECM for @@RJA and i end to add the switch weapon support for NPC, and two new classes of NPCs: CLASS_SITH and CLASS_SITHTROOPER. however, i cannot accomplish the request for a little tecnical problem: first off: i try to start the new Single Player Exe and Dll but it told me there is missing SDL2.dll file. i see here in forum is a file that is into lib folder of openjk solution. after a lot of search i find it. so now code of mode is starting. but when i tryint to load a map give me the error "FAILED TO LOAD JA GAME LIBRARY" during the build, i see there is something missing: common\vm.cpp(26): fatal error C1083: Impossibile aprire il file inclusione 'inttypes.h': No such file or directory client\snd_dma.cpp(36): fatal error C1083: Impossibile aprire il file inclusione 'inttypes.h': No such file or directory. so, inside the solution, there is a missing inttypes. header file. someone know where i can get this file? PS: i am working on ECIV mod source code that RJA passed to me.
-
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
Never done lods and i not know how is possible to do lods. if someone can teach me i will be grateful for moment i ever solved spliitting model. i ask because years ago i do a favour to a friend adding in my mod a character of his creation. the model was doing with a frankesteining of some part of daedric armor of skyrim. i get the ran out error when model get two saber model in combat. i fixed reshaping the fingers of the models with low poly and sharpness. original fingers was really too many complex with thousand of vertexes. i also tryied in past to see how work models of legacy of kain defiance into JKA. they have a medium of 3k of vertexes (kain model) 5k for janos audron model, and 1-2k for other characters. but with the split for doing body parts i never get trouble with these HD models. maybe there is sometjhing odd on my code: recently i player the spoder model mod and when i spawn spoder monster and i hit with a sword i get run out of space error. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
Totally agree. change a value not change that. you need to manually code all effects of every parameters. (by 5 to 20 is a looong work >.< ) @@MGummelt sorry if i disturb again, but i have just a last question: there is some way to overcap the graphical engine limit related to MD3 and GLM? i mean that game crash if a mesh of MD3 model contain more of 1000 vertexes. and also for GLM models same things. also, if a model of character is too many complex or highpoly people get message "ran out of transform ghouls 2 space adjust mini heap size." what mean exactly this error and how is possible to overcap this limit into the code? -
The uniqie explanation i have is that jpg files are not fully compatible with JKA engine (if they are progressive jpg can give problem). otherwise, there is something strange into they SHADER file assets... i get the some trouble in my mod however. nothing of really important, just is boring to see that.
-
Attempting to Remaster JK3
Asgarath83 replied to MusicForThePiano's topic in Mod Requests & Suggestions
i checked a lot of map in radiant and not seem music are setted in worldspawn, so i suppose they are applied by code with dms.dat so editing this file maybe you can reach your goal. For edit track for atr \ etr \ action \ explore theme, you can use audacity i guess or any other software audio editing program rancor track is common to alls because siths are nasty like rancors! XDDD however... should be difficult change music to corellia, zonju V and tanaab level (t1_rail, t2_trip and t3_stamp) it's a monothematic action trace. i fear is definied into map worldspawn. yes, they are. music music/t1_rail/rail_nowhere.mp3 into worldspawn. you cannot change that. i doubt you can do with entity modding because worldspawn changing should require map rebuilding i fear. (i am not sure of that. @@Cerez maybe know the answer. ) -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
Not worry, real life come ever before of virtual life. thanks to you for all help you get to us for our projects About my code troubles: i'm sorry for late but i try to answer about all your consideration. First off, thanks for answers. really, i appreciated and you give me also some new code incipit. SAbout my bug of invisible saber: the NPC file i used for testing my AI get 5 different version of NPC for test all possible weapons behavours: Arcane { playerModel stormtrooper weapon WP_BLASTER_PISTOL weapon WP_BLASTER weapon WP_REPEATER weapon WP_FLECHETTE weapon WP_DEMP2 weapon WP_CONCUSSION weapon WP_BOWCASTER weapon WP_ROCKET_LAUNCHER weapon WP_JAWA weapon WP_POISON // saber dual_3 FP_HEAL 1 FP_LEVITATION 1 FP_DRAIN 1 FP_SEE 1 FP_RAGE 1 FP_PROTECT 1 FP_SPEED 1 FP_PUSH 1 FP_PULL 1 FP_SABER_DEFENSE 1 FP_SABER_OFFENSE 1 FP_SABERTHROW 1 FP_LIGHTNING 1 FP_GRIP 1 FP_TELEPATHY 1 FP_ABSORB 1 FP_FORCEGLYPH 1 forceRegenRate 150 forcePowerMax 100 rank lt reactions 3 aim 1 move 4 aggression 5 evasion 3 intelligence 4 playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_WIZARD yawSpeed 100 walkSpeed 55 runSpeed 160 snd weequay sndcombat weequay sndjedi weequay health 300 dismemberProbHead 30 dismemberProbArms 30 dismemberProbLegs 20 dismemberProbHands 50 dismemberProbWaist 0 } Arcane2 { playerModel stormtrooper // Test per vedere se il modello Dumahim può lanciar granate. altfire 1 weapon WP_BLASTER_PISTOL weapon WP_BLASTER weapon WP_REPEATER weapon WP_FLECHETTE weapon WP_DEMP2 weapon WP_CONCUSSION weapon WP_BOWCASTER weapon WP_ROCKET_LAUNCHER weapon WP_JAWA weapon WP_POISON FP_HEAL 0 FP_LEVITATION 0 FP_DRAIN 0 FP_SEE 0 FP_RAGE 0 FP_PROTECT 0 FP_SPEED 0 FP_PUSH 0 FP_PULL 0 FP_SABER_DEFENSE 0 FP_SABER_OFFENSE 0 FP_SABERTHROW 0 FP_LIGHTNING 0 FP_GRIP 0 FP_TELEPATHY 0 FP_ABSORB 0 FP_FORCEGLYPH 0 forceRegenRate 150 forcePowerMax 100 rank captain reactions 3 aim 1 move 4 aggression 5 evasion 3 intelligence 4 playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_WIZARD yawSpeed 100 walkSpeed 55 runSpeed 160 snd weequay sndcombat weequay sndjedi weequay health 300 dismemberProbHead 30 dismemberProbArms 30 dismemberProbLegs 20 dismemberProbHands 50 dismemberProbWaist 0 } Arcane3 { playerModel stormtrooper // Test per vedere se il modello Dumahim può lanciar granate. weapon WP_SABER saber dual_3 FP_HEAL 1 FP_LEVITATION 1 FP_DRAIN 1 FP_SEE 1 FP_RAGE 1 FP_PROTECT 1 FP_SPEED 1 FP_PUSH 1 FP_PULL 1 FP_SABER_DEFENSE 1 FP_SABER_OFFENSE 1 FP_SABERTHROW 1 FP_LIGHTNING 1 FP_GRIP 1 FP_TELEPATHY 1 FP_ABSORB 1 FP_FORCEGLYPH 1 forceRegenRate 150 forcePowerMax 100 rank lt reactions 3 aim 1 move 4 aggression 5 evasion 3 intelligence 4 playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_WIZARD yawSpeed 100 walkSpeed 55 runSpeed 160 snd weequay sndcombat weequay sndjedi weequay health 300 dismemberProbHead 30 dismemberProbArms 30 dismemberProbLegs 20 dismemberProbHands 50 dismemberProbWaist 0 } Arcane4 { playerModel stormtrooper // Test per vedere se il modello Dumahim può lanciar granate. weapon WP_SABER saber dual_3 // weapon WP_CANNON weapon WP_REPEATER weapon WP_FLECHETTE weapon WP_DEMP2 weapon WP_CONCUSSION weapon WP_BOWCASTER weapon WP_ROCKET_LAUNCHER weapon WP_JAWA weapon WP_POISON FP_HEAL 1 FP_LEVITATION 1 FP_DRAIN 1 FP_SEE 1 FP_RAGE 1 FP_PROTECT 1 FP_SPEED 1 FP_PUSH 1 FP_PULL 1 FP_SABER_DEFENSE 1 FP_SABER_OFFENSE 1 FP_SABERTHROW 1 FP_LIGHTNING 1 FP_GRIP 1 FP_TELEPATHY 1 FP_ABSORB 1 FP_FORCEGLYPH 1 forceRegenRate 150 forcePowerMax 100 rank lt reactions 3 aim 1 move 4 aggression 5 evasion 3 intelligence 4 playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_WIZARD yawSpeed 100 walkSpeed 55 runSpeed 160 snd weequay sndcombat weequay sndjedi weequay health 300 dismemberProbHead 30 dismemberProbArms 30 dismemberProbLegs 20 dismemberProbHands 50 dismemberProbWaist 0 } Arcane5 { playerModel stormtrooper // Test per vedere se il modello Dumahim può lanciar granate. weapon WP_TUSKEN_STAFF weapon WP_TUSKEN_RIFLE weapon WP_BLOODGUN weapon WP_CANNON weapon WP_DISRUPTOR weapon WP_BRYAR_PISTOL weapon WP_THERMAL FP_HEAL 1 FP_LEVITATION 1 FP_DRAIN 1 FP_SEE 1 FP_RAGE 1 FP_PROTECT 1 FP_SPEED 1 FP_PUSH 1 FP_PULL 1 FP_SABER_DEFENSE 1 FP_SABER_OFFENSE 1 FP_SABERTHROW 1 FP_LIGHTNING 1 FP_GRIP 1 FP_TELEPATHY 1 FP_ABSORB 1 FP_FORCEGLYPH 1 forceRegenRate 150 forcePowerMax 100 rank lt reactions 3 aim 1 move 4 aggression 5 evasion 3 intelligence 4 playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_WIZARD yawSpeed 100 walkSpeed 55 runSpeed 160 snd weequay sndcombat weequay sndjedi weequay health 300 dismemberProbHead 30 dismemberProbArms 30 dismemberProbLegs 20 dismemberProbHands 50 dismemberProbWaist 0 } the dual_3 model saber is replaced by a magic scepter imbue with fire power, but it works perfectly fine as model if get to player with saber cheat command consolle. arcane1 is for testing AI switching weapon basic behavour. the 2 is for testing altfire behavour and advanced and more smart fight. 3 is for testing saber only - saberist behavour. 4 testing the switching before saber and other weapons (and was four to not working fine) 5 is for testing last set of weapons. WP_JAWA is modded for is a sonic shoot stun weapon. it works well. i fixed also his fire rate. WP_BRYAR_PISTOL is turned into a magic bow. disruptor into a sniper bow. tusken rifle into a bowcaster with magic arrows. as i told in the other thread (where i post the AI code related to switching weapons) the problem was when NPC get player \ enemy close, it equip saber for fight. it works fight. it activate NPC_fencer state and this state switch weapon to saber. (yes,. in past i tried also the set_saber function of icarus script, but in this contest it not work much fine) the adding of NPC_FENCER state fixed the saber invisible model trouble. the problem was the NPC not leave NPC_FENCER state, because into NPC.cpp there is a condituion related to else if (NPC->client->ps.weapon == WP_SABER )... it activate Jedi behavour for all NPC with saber, for all classes. my AI is done cloning and editing boba fett AI and renaming functions for avoid overwriting or function conflict or function duplicated. basically, NPC_FENCER activate also, with saber, the statement of jedi behavour, so NPC fight like a jedi and forget to fight like bobafett. because into AI_jedi.cpp there is nothing concerned switch weapons, NPC not change more his state. i fix that editing the NPC.cpp condition in that way: else if ( NPC->client->ps.weapon == WP_SABER && NPC->client->NPC_class != CLASS_WIZARD ) {//jedi NPC_BehaviorSet_Jedi( bState ); dontSetAim = qtrue; } because my AI use this behavour: else if ( NPC->client->NPC_class == CLASS_WIZARD ) { NPC_Update(); if (NPCInfo->surrenderTime) { NPC_Flee(); } else { if (!NPC_Tactics()) { if ( NPC_Flying( NPC ) ) { NPC_BehaviorSet_Seeker(bState); //NPC_BSRT_Default(); } else { NPC_BehaviorSet_Jedi( bState ); } } dontSetAim = qtrue; } } this avoid interferences and now All works fine! About your suggest: -so is possible to create with code the saber bladetrace that cut and damages the enemy in artificial way. pretty interessing! I will conserve this suggest. sure can be useful in future. maybe some day i can use for create a monster with multiple sabertrace generated by code D: for moment for some monster creature i workaround the fact that a monster cannot carry more of two saber moving into model project on max the r_hand , l_hand tag on the position i want the moster doing saber damage (example... inside the mouth) or where i want it shoots force lightning or other things. - yes, working on an looong if \ else statement about specific saber name that do specific saber damage is not exaclty the more friendly code work. you suggest me a good alternative: working on MOD and add the name exception into the MOD statements. nice suggest. thanks! I discover casually the interference of behavour state that cause the problem of saber switch because after some hundred of test into t3_bounty map with npc fight simulation i noticed that a normal reborn \ other class npc turn off saber when i set into notarget cheats. the boba fett ai instead, not turn off the saber if player "disappering" so for that i understand that my Ai follow some strange behavour related to saber combat. and i checked AI_jedi.cpp and i see there is a counter about aggression level of saberist that turn down weapons after a lot of time, when aggression level is sufficient low after lost the enemy. after that and a lot of test around AI_jedi.cpp also about some saber function, i discovered the origin of the problem lead on NPC.cpp and so i found the cause. -
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.
-
Attempting to Remaster JK3
Asgarath83 replied to MusicForThePiano's topic in Mod Requests & Suggestions
Music editing: yon can opn the dinamic sound track file (dms.dat) inside ext_data with notepad and edit the tracks of map level with this file, replacing also the musics inside music folder (action, explore, and various intermedium sequence music ) with your new edited tracks. Map Editing: for map edit is used gtk radiant 1.5.0 but you need the ja SDK tools for working with that. you can decompile the maps with a batch process with the q3map2 compiler include with gtk radiant. BUT: - decompiled maps can get horrible holies and structural problems. - decompiled maps lose all texture allignement uvmapping. - decompiled maps lose all lighting entities information. so the best way, without decompiling a map, is using the entity modding and ent modding system with openjk. check around the forum about all this threads. we are fully discuss about all these things in the past. And also, there is problem of intellectual properties of the map. many modder and editor are protectives of they job so you need to contact the author of a map before editing the map. the forum policy regard file upload avoid to upload contains of other mods without original author permissions. -
-
Can anyone make K-2SO or HK-47?
Asgarath83 replied to Nikomaru14's topic in Mod Requests & Suggestions
If Hk calls peoples "meat bag" when he shoot, should be the best -
Hello to alls, i am sorry for disturb but really is an entire week then i try in every way possible to do that and i have not success... basically... i am working on new AI for NPC of SP. the new AI act like boba fett ai, basically, but without flamethrower attack. is an improved version of AI that i builded following suggest of Dusty, he has given to me with very kindness. what is the problem... well basically this is an advaned AI for NPC. NPC class that use these AI act very smartly - they dodge lightsaber if you try to cut they with sword. - they randomly switch weapons get into NPC file on ext_data related to NPC that using this AI. - they randomly use altfire. - they can use force power lightning, grip and drain when they shoots, so you can create also advanced reborn or cultist shooter that fight very hard to defeat. - If player is close on a distance lower of 512 map unit, and if a NPC is equipped with a saber on NPC file as weapon, it equip immediatly saber for fight player. there is only one step that not work: i want that: if the player is suffcient far by NPC and NPC is using a saber a as weapon, and NPC have also shooting weapons into his NPC file, he switch by saber to a random shoot weapon present in NPC file. unfortunely, this last feature not works. the NPC still ostinated using saber chasing player with this weapon, also is player is pretty far or is in another platform or cliff or over an abyss. i think this is little stupid, because if i have a sword and a rifle, and i need to fight with someone very far from me, why i need to use the sword when i can shoot with rifle? this is the reason of my frustration. i paste here the incriminated code that cause these issue. i think i need to edit the "else if (enemyInShootRange2)" brank field for fixing that but i not know exactly how. also, i have a little question: where is the difference by ent->s.weapon and ent->client->ps.weapon inside the code? what does one? what does the other exactly? thanks to any answer. @@Dusty @@MGummelt void NPC_TacticsSelect() { // Don't Change Tactics For A Little While //------------------------------------------ TIMER_Set(NPC, "NPC_TacticsSelect", Q_irand(8000, 15000)); int nextState = NPCInfo->localState; // Get Some Data That Will Help With The Selection Of The Next Tactic //-------------------------------------------------------------------- bool enemyAlive2 = (NPC->enemy->health>0); float enemyDistance2 = Distance(NPC->currentOrigin, NPC->enemy->currentOrigin); bool enemyCloseRange2 = (enemyDistance2<NPC_SHOOTRANGEMIN); bool enemyInShootRange2 = (enemyDistance2>NPC_SHOOTRANGEMIN && enemyDistance2<NPC_SHOOTRANGEMAX); bool enemyRecentlySeen2 = NPC_CanSeeEnemy(NPC); if (!enemyAlive2) { nextState = NPC_MAGIC; } else if (enemyCloseRange2)// Enemy is pretty near, so use Saber! { if ( HaveWeapon(NPC, WP_SABER ))// If Enemy is near, and NPC have a sword in his inventory, using that sword. { nextState = NPC_FENCER; } // If It's Been Long Enough Since Our Last Flame Blast, Try To Torch The Enemy //----------------------------------------------------------------------------- //if (TIMER_Done(NPC, "nextFlameDelay")) // DUSTY ADD else if (TIMER_Done(NPC, "nextFlameDelay") && (NPC->client->NPC_class == CLASS_BOBAFETT || NPC->client->NPC_class == CLASS_MANDA)) { nextState = NPC_GLYPHIC; } // Otherwise, He's Probably Too Close, So Try To Get Clear Of Him //---------------------------------------------------------------- else { nextState = NPC_MAGIC; } } else if (enemyInShootRange2)// Enemy is distance so use shoot atk { if ( HaveWeapon(NPC, WP_SABER ) || HaveWeapon(NPC, WP_MELEE ) || HaveWeapon(NPC, WP_TUSKEN_STAFF ) || HaveWeapon(NPC, WP_STUN_BATON )) // You are a warrior and have a sword, but enemy is far and at shoot distance // Put away the sword and use shoot weapons! { if ( HaveWeapon(NPC, WEAPS_BLASTER ))// Enemy is distance, you are a wizard? shoot with magic { nextState = NPC_MAGIC; } else if ( HaveWeapon(NPC, WEAPS_HEAVY ))// Enemy is distance? You are an Hunter? use glyphic weapons { nextState = NPC_GLYPHIC; } else if ( HaveWeapon(NPC, WEAPS_LIGHTBLASTER ))// You are an archer? use arrows! { nextState = NPC_ARROWS; } else if ( HaveWeapon(NPC, WEAPS_HEAVYBLASTER ))// You are a Necromancer or a chieric? Use this attacks! { nextState = NPC_NEC_HOLY; } } else { // If you have shooting weapons, use that! if ( HaveWeapon(NPC, WEAPS_BLASTER ))// Enemy is distance, you are a wizard? shoot with magic { nextState = NPC_MAGIC; } else if ( HaveWeapon(NPC, WEAPS_HEAVY ))// Enemy is distance? You are an Hunter? use glyphic weapons { nextState = NPC_GLYPHIC; } else if ( HaveWeapon(NPC, WEAPS_LIGHTBLASTER ))// You are an archer? use arrows! { nextState = NPC_ARROWS; } else if ( HaveWeapon(NPC, WEAPS_HEAVYBLASTER ))// You are a Necromancer or a chieric? Use this attacks! { nextState = NPC_NEC_HOLY; } else if ( HaveWeapon(NPC, WEAPS_MELEE ))// this is really stupid but okay... { nextState = NPC_WARRIOR; } } } else if (!enemyInShootRange2 && !enemyCloseRange2) // Enemy is pretty far, try distance atk { // If It's Been Long Enough Since Our Last Flame Blast, Try To Torch The Enemy //----------------------------------------------------------------------------- //if (TIMER_Done(NPC, "nextFlameDelay")) // DUSTY ADD if ( HaveWeapon(NPC, WP_SABER ) || HaveWeapon(NPC, WP_MELEE ) || HaveWeapon(NPC, WP_TUSKEN_STAFF ) || HaveWeapon(NPC, WP_STUN_BATON )) // You are a warrior and have a sword, but enemy is far and at shoot distance // Put away the sword and use shoot weapons! { if ( HaveWeapon(NPC, WEAPS_BLASTER ))// Enemy is distance, you are a wizard? shoot with magic { nextState = NPC_MAGIC; } else if ( HaveWeapon(NPC, WEAPS_HEAVY ))// Enemy is distance? You are an Hunter? use glyphic weapons { nextState = NPC_GLYPHIC; } else if ( HaveWeapon(NPC, WEAPS_LIGHTBLASTER ))// You are an archer? use arrows! { nextState = NPC_ARROWS; } else if ( HaveWeapon(NPC, WEAPS_HEAVYBLASTER ))// You are a Necromancer or a chieric? Use this attacks! { nextState = NPC_NEC_HOLY; } } else { // If you have shooting weapons, use that! if ( HaveWeapon(NPC, WEAPS_BLASTER ))// Enemy is distance, you are a wizard? shoot with magic { nextState = NPC_MAGIC; } else if ( HaveWeapon(NPC, WEAPS_HEAVY ))// Enemy is distance? You are an Hunter? use glyphic weapons { nextState = NPC_GLYPHIC; } else if ( HaveWeapon(NPC, WEAPS_LIGHTBLASTER ))// You are an archer? use arrows! { nextState = NPC_ARROWS; } else if ( HaveWeapon(NPC, WEAPS_HEAVYBLASTER ))// You are a Necromancer or a chieric? Use this attacks! { nextState = NPC_NEC_HOLY; } else if ( HaveWeapon(NPC, WEAPS_MELEE ))// this is really stupid but okay... { nextState = NPC_WARRIOR; } } } // Recently Saw The Enemy, Time For Some Good Ole Fighten! //--------------------------------------------------------- else if (enemyRecentlySeen2) { // At First, Boba will prefer to use his blaster against the player, but // the more times he is driven away (NPC->count), he will be less likely to // choose the blaster, and more likely to go for the missile launcher //nextState = (!enemyInShootRange || Q_irand(0, NPC->count)<1)?(NPC_MAGIC):(NPC_FENCER); } // Hmmm... Havn't Seen The Player In A While, We Might Want To Try Something Sneaky //----------------------------------------------------------------------------------- else { bool SnipePointsNear = false; // TODO bool AmbushPointNear = false; // TODO if (Q_irand(0, NPC->count)>0) { int SniperPoint = NPC_FindCombatPoint(NPC->currentOrigin, 0, NPC->currentOrigin, CP_SNIPE|CP_CLEAR|CP_HAS_ROUTE|CP_TRYFAR|CP_HORZ_DIST_COLL, 0, -1); if (SniperPoint!=-1) { NPC_SetCombatPoint(SniperPoint); NPC_SetMoveGoal( NPC, level.combatPoints[SniperPoint].origin, 20, qtrue, SniperPoint ); TIMER_Set(NPC, "PickNewSniperPoint", Q_irand(15000, 25000)); SnipePointsNear = true; } } // DUSTY ADD //if (SnipePointsNear && TIMER_Done(NPC, "NPC_NoSniperTime")) if (SnipePointsNear && TIMER_Done(NPC, "NPC_NoSniperTime") && HaveWeapon(NPC, WP_DISRUPTOR)) { TIMER_Set(NPC, "NPC_NoSniperTime", 120000); // Don't snipe again for a while TIMER_Set(NPC, "NPC_TacticsSelect", Q_irand(35000, 45000));// More patience here nextState = NPC_ARROWS; } else if (AmbushPointNear) { TIMER_Set(NPC, "NPC_TacticsSelect", Q_irand(15000, 25000));// More patience here nextState = NPC_AMBUSHWAIT; } else { nextState = (!enemyInShootRange2 || Q_irand(0, NPC->count)<1)?(NPC_GLYPHIC):(NPC_ARROWS); } } // The Next State Has Been Selected, Now Change Weapon If Necessary //------------------------------------------------------------------ // DUSTY ADD VERSION // The Next State Has Been Selected, Now Change Weapon If Necessary //------------------------------------------------------------------ NPCInfo->localState = nextState; int weapon = 0; switch (NPCInfo->localState) { case NPC_FENCER: if (HaveWeapon(NPC, WP_SABER)) { //NPC_Printf("NEW TACTIC: Sniper"); NPC_ChangeWeapon(WP_SABER); break; } case NPC_MAGIC: weapon = ChooseWeaponRandom(NPC, WEAPS_BLASTER); if (weapon) { //NPC_Printf("NEW TACTIC: Rifle"); NPC_ChangeWeapon(weapon); break; } case NPC_NEC_HOLY: weapon = ChooseWeaponRandom(NPC, WEAPS_HEAVYBLASTER); if (weapon) { //NPC_Printf("NEW TACTIC: Rocket Launcher"); NPC_ChangeWeapon(weapon); break; } case NPC_GLYPHIC: //kinda stuck at this point if doesn't have flamethrower //NPC_Printf("NEW TACTIC: Flame Thrower"); weapon = ChooseWeaponRandom(NPC, WEAPS_HEAVY); if (weapon) { //NPC_Printf("NEW TACTIC: Rocket Launcher"); NPC_ChangeWeapon(weapon); break; } case NPC_WARRIOR: //kinda stuck at this point if doesn't have flamethrower //NPC_Printf("NEW TACTIC: Flame Thrower"); weapon = ChooseWeaponRandom(NPC, WEAPS_MELEE); if (weapon) { //NPC_Printf("NEW TACTIC: Rocket Launcher"); NPC_ChangeWeapon(weapon); break; } case NPC_ARROWS: //kinda stuck at this point if doesn't have flamethrower //NPC_Printf("NEW TACTIC: Flame Thrower"); weapon = ChooseWeaponRandom(NPC, WEAPS_LIGHTBLASTER); if (weapon) { //NPC_Printf("NEW TACTIC: Rocket Launcher"); NPC_ChangeWeapon(weapon); break; } case NPC_AMBUSHWAIT: //NPC_Printf("NEW TACTIC: Ambush"); weapon = ChooseWeaponRandom(NPC, WEAPS_ALL); if (weapon) { //NPC_Printf("NEW TACTIC: Rocket Launcher"); NPC_ChangeWeapon(weapon); break; } } } NOTE: weapons are grouped into cathegories. on weapons.h ////////////// WEAPON GROUPS typedef enum { WEAPS_ALL, WEAPS_BLASTER, WEAPS_HEAVY,// Glifiche WEAPS_LIGHTBLASTER,// Arrows WEAPS_HEAVYBLASTER,// nec Holy WEAPS_EXPLOSIVE, // Explosive WEAPS_MELEE, //Warrior WEAPS_OTHER } weaponGroup; they are associated at int definitions on npc_combat.cpp: qboolean WeaponInGroup(int weapon, int wpnGroup, int altFire = 0) {//this and the funcs it calls do the heavy lifting for weapon grouping if ((heavyWeap(weapon) && wpnGroup == WEAPS_HEAVY) // Glifiche || (lightBlasterWeap(weapon) && wpnGroup == WEAPS_LIGHTBLASTER) // Arrows || (heavyBlasterWeap(weapon) && wpnGroup == WEAPS_HEAVYBLASTER) // nec Holy || (blasterWeap(weapon) && wpnGroup == WEAPS_BLASTER )// Magic || ( meleeWeap(weapon) && wpnGroup == WEAPS_MELEE ) // Warrior || wpnGroup == WEAPS_ALL ) { return qtrue; } return qfalse; }and they are groped in that way on g_weapons.cpp: qboolean heavyWeap(int wp)//humans { switch (wp) { case WP_CANNON: case WP_TUSKEN_RIFLE: case WP_BRYAR_PISTOL: case WP_BLOODGUN: case WP_THERMAL: case WP_TRIP_MINE: case WP_DET_PACK: case WP_EMPLACED_GUN: return qtrue; } return qfalse; } qboolean blasterWeap(int wp)//elementals { switch (wp) { case WP_BLASTER_PISTOL: case WP_BLASTER: case WP_REPEATER: case WP_BOWCASTER: case WP_ROCKET_LAUNCHER: case WP_FLECHETTE: case WP_JAWA: case WP_POISON: case WP_CONCUSSION: case WP_DEMP2: case WP_NOGHRI_STICK: case WP_ATST_MAIN: case WP_ATST_SIDE: return qtrue; } return qfalse; } qboolean lightBlasterWeap(int wp)// Arrows { switch (wp) { case WP_TUSKEN_RIFLE: case WP_DISRUPTOR: case WP_NOGHRI_STICK: case WP_BRYAR_PISTOL: return qtrue; } return qfalse; } qboolean heavyBlasterWeap(int wp)// Life&Necro { switch (wp) { case WP_CONCUSSION: case WP_DEMP2: return qtrue; } return qfalse; } qboolean meleeWeap(int wp) // Melee fight { switch (wp) { case WP_MELEE: case WP_STUN_BATON: case WP_TUSKEN_STAFF: return qtrue; } return qfalse; } // End Weapon categories
-
Well, turbolasers on t2_wedge are md3 models i think and they move and shoots... but me too, i have no idea about how animate an MD3.
-
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
remember me when Vader lock with hand blasters of Han Solo on empire strikes back. nice idea! -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
Nevermind, i am fixing it. it's a problem of the AI, not of the change weapon function. : 3 thanks for all attention. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
@@MGummelt sorry if i ask but maybe you can give me a little incipit also about my trouble. i am doing with dusty help a special AI that allow to npc to: - switch weapons and use altfire randomly in fight. they can also use force power when they shoot player! it's pretty fun because player can be force gripped when is shooted by a cultist armored with WP_FLECHETTE, for example. so, enemies use all arsenal inside the NPCfile of the NPC for fight the player. this AI is based on cultist commando's dusty and bobafett AI code. it's work fine, but i have a serious probem concerned sabers. basically, i have a NPC with two weapons: a variant of WP_FLECHETTE (WP_CANNON) and WP_SABER with saber dual_2. npc should randomly switch and alternate the flechette \ cannon fight mode with saberist mode, switching by flechette and saber. and yes, it does that. but there is a little problem: when NPC switch weapon to saber, saber model is basically invisible and also not make any kind of damage (because saber have not a damagetrace, because model of saber is not respawned) , so NPC AI workaround that acting like a reborn cultist, using simply force powers and "hands" as weapon. he not do saber swings, but i see he does the saber taunts... and sometimes i ears in game the sound of saberon , so the sabere there is... but the moel is not displayed in game. i am trying to fixing the thing working on NPC_combat about a new version of NPC_changeweapon code related to dusty's patch. but i have not much success. how i need to do for allow to NPCs to switch correctly by a shooting weapon to a saber weapon? this is the npc switch weapon function code, it's all morning i am trying to fix that and i am little tired. void NPC_ChangeWeapon( int newWeapon ) { qboolean changing = qfalse; if ( newWeapon != NPC->client->ps.weapon ) { changing = qtrue; } if ( changing ) { G_RemoveWeaponModels( NPC ); } ChangeWeapon( NPC, newWeapon ); if ( changing && NPC->client->ps.weapon != WP_NONE ) { if ( NPC->client->ps.weapon == WP_SABER ) { WP_SaberAddG2SaberModels( NPC ); } else { G_CreateG2AttachedWeaponModel( NPC, weaponData[NPC->client->ps.weapon].weaponMdl, NPC->handRBolt, 0 ); } } } sorry if i ask it, but i am in that empasse by some days. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
Thanks, but there are coder more good of me good luck with your mod and have fun. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
lol in that moment i am little stressed and tired. there a problem into my code that become me little crazy. about your problem: you can do that working on MOD_SABER too. if damage of MOD_SABER is *= 0, like demp2 code for assassin droid for these class, they become invincible to saber. about saber parry... i am cannot know how can i help you about a super parry code, but as you can see, there is a workaround about the boba fett deflecting saber throw code that you can use for prevent to hit these classes with saber throws. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
mmm... first off, are you pretty sure is a good gameplay choice make Galak mech and shadowtrooper immune to saber damage with a suit that can parry the swings or saber throws? because shadowtrooper can push explosive weapons and deflect blaster with saber, so with this feature is pratically an invincible adversary. if you wanna add a simple saber resistance to shadow trooper, like hazard trooper class, you need just to go into G_combat.cpp and add this low if ( client && client->NPC_class == CLASS_SHADOWTROOPER ) { if ( mod == MOD_SABER && damage>0 && !(dflags&DAMAGE_NO_PROTECTION) ) { damage /= 9; } } under the same condition related hazardtrooper. Edit, wait a moment. i am checking now... you are editing a function that is previous in file of function you are calling. so when compiler build the solution and read the file, not found the function, because the void is after your add. mmm i tryed to cut and paste the saberparry function upper the file, but i get error about other functions. is not easy to do that, because require to re-order all the functions of wp_saber.cpp for allows to the compiler of read all the definition in the new right sequence. should be a long task and i cannot help you in that. :\ however, if i remember fine, boba fett armor can parry and deflect the saber throws. maybe you can do a workaround about this feature. mmmm yep i got that if ( attacker && attacker->client && attacker->client->ps.saberInFlight ) {//thrown saber hit something if ( ( hitEnt && hitEnt->client && hitEnt->health > 0 && ( hitEnt->client->NPC_class == CLASS_DESANN || !Q_stricmp("Yoda",hitEnt->NPC_type) || hitEnt->client->NPC_class == CLASS_LUKE || hitEnt->client->NPC_class == CLASS_BOBAFETT || (hitEnt->client->ps.powerups[PW_GALAK_SHIELD] > 0) ) ) || ( owner && owner->client && owner->health > 0 && ( owner->client->NPC_class == CLASS_DESANN || !Q_stricmp("Yoda",owner->NPC_type) || owner->client->NPC_class == CLASS_LUKE || (owner->client->ps.powerups[PW_GALAK_SHIELD] > 0) ) ) ) {//Luke and Desann slap thrown sabers aside //FIXME: control the direction of the thrown saber... if hit Galak's shield, bounce directly away from his origin? WP_SaberKnockaway( attacker, &tr ); add shadowtrooper class in this if field and shadowtrooper become invincible to saber throw. after you can add a resistance to saber damage in g_combat of 90% and that should be okay. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
Because you need to declair or define the function at the start of file you're editing, and it need to be pointed to the function inside the other file. right click of mouse on WP_saberparry and go to definition option. you need to add into the file the line: "extern qboolean WP_SaberParry( gentity_t *victim, gentity_t *attacker, int saberNum, int bladeNum )" if instead the function is in the file itself, maybe the function is in a lower section of code respect of the code part you are editing. (so compiler cannot find the function?) try to cut and paste the function upon. -
Ask me anything about the Jedi source code
Asgarath83 replied to MGummelt's topic in Coding and Scripts
Yes, total conversion. Thanks @@Penekowski is also possible to add a different kind of damage to a specific saber you create on SAB files: if ( saberType == SABER_SITH_SWORD ) {//do knockback dFlags &= ~(DAMAGE_NO_KNOCKBACK|DAMAGE_DEATH_KNOCKBACK); } if ( !WP_SaberBladeUseSecondBladeStyle( &ent->client->ps.saber[saberNum], bladeNum ) && ent->client->ps.saber[saberNum].knockbackScale > 0.0f ) { dFlags &= ~(DAMAGE_NO_KNOCKBACK|DAMAGE_DEATH_KNOCKBACK); if ( saberNum < 1 ) { dFlags |= DAMAGE_SABER_KNOCKBACK1; } else { dFlags |= DAMAGE_SABER_KNOCKBACK2; } } else if ( WP_SaberBladeUseSecondBladeStyle( &ent->client->ps.saber[saberNum], bladeNum ) && ent->client->ps.saber[saberNum].knockbackScale2 > 0.0f ) { dFlags &= ~(DAMAGE_NO_KNOCKBACK|DAMAGE_DEATH_KNOCKBACK); if ( saberNum < 1 ) { dFlags |= DAMAGE_SABER_KNOCKBACK1_B2; } else { dFlags |= DAMAGE_SABER_KNOCKBACK2_B2; } } if ( thrownSaber ) { inflictor = &g_entities[ent->client->ps.saberEntityNum]; } int damage = 0; if ( !WP_SaberBladeUseSecondBladeStyle( &ent->client->ps.saber[saberNum], bladeNum ) && ent->client->ps.saber[saberNum].damageScale != 1.0f ) { damage = ceil(totalDmg[i]*ent->client->ps.saber[saberNum].damageScale); } else if ( WP_SaberBladeUseSecondBladeStyle( &ent->client->ps.saber[saberNum], bladeNum ) && ent->client->ps.saber[saberNum].damageScale2 != 1.0f ) { damage = ceil(totalDmg[i]*ent->client->ps.saber[saberNum].damageScale2); } else { damage = ceil(totalDmg[i]); } // DANNO SPADA // SPADE DI TENEBRE if(!Q_stricmp( ent->client->ps.saber[saberNum].fullName, "Dark Reaver")) { G_Damage( victim, inflictor, ent, dmgDir[i], dmgSpot[i], damage, dFlags, MOD_BRYAR, hitDismemberLoc[i] ); } else if(!Q_stricmp( ent->client->ps.saber[saberNum].fullName, "Smog Reaver")) { G_Damage( victim, inflictor, ent, dmgDir[i], dmgSpot[i], damage, dFlags, MOD_BRYAR_ALT, hitDismemberLoc[i] ); G_Damage( victim, inflictor, ent, dmgDir[i], dmgSpot[i], damage, dFlags, MOD_BLASTER, hitDismemberLoc[i] ); } else if(!Q_stricmp( ent->client->ps.saber[saberNum].fullName, "Void Reaver")) { G_Damage( victim, inflictor, ent, dmgDir[i], dmgSpot[i], damage, dFlags, MOD_BRYAR_ALT, hitDismemberLoc[i] ); G_Damage( victim, inflictor, ent, dmgDir[i], dmgSpot[i], damage, dFlags, MOD_ROCKET, hitDismemberLoc[i] ); } else if(!Q_stricmp( ent->client->ps.saber[saberNum].fullName, "Lightning Reaver")) { G_Damage( victim, inflictor, ent, dmgDir[i], dmgSpot[i], damage, dFlags, MOD_ELECTROCUTE, hitDismemberLoc[i] ); if ( victim && victim->client && victim->health >= 0 ) { victim->s.powerups |= ( 1 << PW_SHOCKED ); victim->client->ps.powerups[PW_SHOCKED] = cg.time + 1000; } } else if(!Q_stricmp( ent->client->ps.saber[saberNum].fullName, "Sunlight Reaver")) { G_Damage( victim, inflictor, ent, dmgDir[i], dmgSpot[i], damage, dFlags, MOD_SNIPER, hitDismemberLoc[i] ); if ( victim && victim->client && victim->health >= 1 ) { victim->s.powerups |= ( 1 << PW_SHOCKED ); victim->client->ps.powerups[PW_SHOCKED] = cg.time + 1000; } } doing something like that on wp_saber.cpp, you can create a specific saber (later you add this on ext_data/sabers folder. that inflict special damage and damage effect to enemies with custom MOD. so you can do same saber that is deadly against droid because inflicting damage with MOD_DEMP2 . otherwise you can add new Mods and set on g_combat for be deadly against jedi, sith or force users, and so you can get sabers inbued with Light side of force and other with dark side. you can see into the example tree a black hole \ dark sabers, an electric saber that electrocuted enemy hitted, and a disgregator saber. enemy killed by MOD_SNIPER die with body disintegration, like disruptor rifle.