Jump to content

Asgarath83

Members
  • Posts

    2,023
  • Joined

  • Last visited

Everything posted by Asgarath83

  1. found on NPC_spawn.cpp the NPC_canfly field and the parameter that nullify gravity for probe and sentry droids. added this exception to the new class. Now should move flying and not silly jumping. Well... works for NPC. in the time i wrote AI for fighter, they fight like bobafett \ sithtroper of ecm IV (but flying chasing player and changing weapons.) need really an auto forward movement for be realistic. >.< for player again not work much. not leave land.
  2. However now i post a little list of what missing: 0 - NPC and class and death explosion effect. done. to do: 1 -movement: player. (hover movement, auto fastforward and rolling and other command like a vehicle for this class. no letal colliding with map geometries.) 2 - weapon system model and efx changed for match a fighter (but this can be not too difficult. i have a lot of experience in weapons) 3 -disabling force power and saber (a fighter sure cannot use XD but this is easy for force power... for saber... i have not idea how to avoid a class to use the saber as weapon) 4 - NPC fully combat AI for enemy fighters.
  3. No cockpit. as NPC \ playermodel first person is just clean. it need some special code in cg_draw for a custom HUD for fighter i guess.
  4. Nice idea of doing cockpit by md3 hand model first person view of weapon of NPC-vehicle. o.o the problem is: on SP the models of weapons are stored into weapons.dat so i need to change this setting by code (like it works on MP) for allow to work with various modded weapons. example: the blaster pistol for a fighter can become a blaster pulse weapon, the blaster rifle the normal blaster cannon, the demp2 a em pulse weapon for easily explode enemy fighter, flechette and thermal can become bombs weapon or frag weapons, stouker and rocket proton and concussion torpedo weapons.... mmm this is more big and complicated of what i thinked before. into the time... i am not again idea how to automove forward a npc fighter... so for moment i create the death explosion effect with body disappering into g_combat.cpp, in the deathfx code related to droids explosions. case CLASS_FIGHTER: VectorCopy( ent->currentOrigin, effectPos ); ent->client->ps.powerups[PW_DISRUPTION] = cg.time + 1000; G_PlayEffect( "ships/tf_explosion", effectPos ); break;
  5. lol i wanna point up this is NOT a tie fighter vehicle but a tie fighter NPC. that for moment "fly" because i use noclip cheat. now i want it to fly by coding the class of npc file. this is the hardest part. the die with explosion and model disappering is easy instead. the AI of npc fighter is more hard because they should shoot player and fly around it, and chase, pursuit, rolling and do evsion moves if are shooted. not really easy to program. (shoud nace if a "fighter" evasion ability is setted with "evasion" parm of npc file and the fighter combat ability with "aggression" and the rank will change all these parameters in a global way. but this is too hard for me alone to code. )
  6. okay, i defined class into the code and do npc file file. is a little start point. tomorrow i will see how to get an automatic "noclip" cheat on this class without disabling of colliding with geometry. after i see about movement and autofastforward. sure i will change noclip commands (with mouse i want to shoot, not to boost lol XD. boost will be W key. ) https://ibb.co/gZyqHv https://ibb.co/mRP84a camera is okay only when you go forward mmm... at this point or i scale the fighter on npc file(but this will require custom map... instead of doing for fight giants map arena maybe do a fighter big like a player??? O.o ) otherwise it need a little fix on camera code. (i think drivable atst HAS a camera fixed ) Again not shoot however
  7. oh, okay at this point the things are 3: - make a fighter usable and become drivable like atst. - make a NPC fighter (when spawn with playermodel "nameoffighter" you are already inside and flighting. YOU are the fighter. - NPC fighters for dogfight, with AI. this is nasty because i can also duplicate sentry AI for shooting but for movement, acrobacy, rolling, chasing the player... Help! D:
  8. okay should be noclip movement. i think is a start point. void NPC_BSNoClip ( void ) { if ( UpdateGoal() ) { vec3_t dir, forward, right, angles, up = {0, 0, 1}; float fDot, rDot, uDot; VectorSubtract( NPCInfo->goalEntity->currentOrigin, NPC->currentOrigin, dir ); vectoangles( dir, angles ); NPCInfo->desiredYaw = angles[YAW]; AngleVectors( NPC->currentAngles, forward, right, NULL ); VectorNormalize( dir ); fDot = DotProduct(forward, dir) * 127; rDot = DotProduct(right, dir) * 127; uDot = DotProduct(up, dir) * 127; ucmd.forwardmove = floor(fDot); ucmd.rightmove = floor(rDot); ucmd.upmove = floor(uDot); } else { //Cut velocity? VectorClear( NPC->client->ps.velocity ); } NPC_UpdateAngles( qtrue, qtrue ); }
  9. rotfl sorry i not understood "unmanned" now yes. ahahaha a ship without crew. XDDD well, is just a ghost shipwreck loooool XD some navigation problen, maybe. ^^
  10. g_misc.cpp found about atst basic stuff /*QUAKED misc_atst_drivable (1 0 0.25) (-40 -40 -24) (40 40 248) model="models/players/atst/model.glm" Drivable ATST, when used by player, they become the ATST. When the player hits use again, they get out. "health" - how much health the atst has - default 800 "target" - what to use when it dies */ void misc_atst_setanim( gentity_t *self, int bone, int anim ) { if ( bone < 0 || anim < 0 ) { return; } int firstFrame = -1; int lastFrame = -1; float animSpeed = 0; //try to get anim ranges from the animation.cfg for an AT-ST for ( int i = 0; i < level.numKnownAnimFileSets; i++ ) { if ( !Q_stricmp( "atst", level.knownAnimFileSets[i].filename ) ) { firstFrame = level.knownAnimFileSets[i].animations[anim].firstFrame; lastFrame = firstFrame+level.knownAnimFileSets[i].animations[anim].numFrames; animSpeed = 50.0f / level.knownAnimFileSets[i].animations[anim].frameLerp; break; } } if ( firstFrame != -1 && lastFrame != -1 && animSpeed != 0 ) { if (!gi.G2API_SetBoneAnimIndex( &self->ghoul2[self->playerModel], bone, firstFrame, lastFrame, BONE_ANIM_OVERRIDE_FREEZE|BONE_ANIM_BLEND, animSpeed, (cg.time?cg.time:level.time), -1, 150 )) { gi.G2API_SetBoneAnimIndex( &self->ghoul2[self->playerModel], bone, firstFrame, lastFrame, BONE_ANIM_OVERRIDE_FREEZE, animSpeed, (cg.time?cg.time:level.time), -1, 150 ); } } } void misc_atst_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod,int dFlags,int hitLoc ) {//ATST was destroyed while you weren't in it //can't be used anymore self->e_UseFunc = useF_NULL; //sigh... remove contents so we don't block the player's path... self->contents = CONTENTS_CORPSE; self->takedamage = qfalse; self->maxs[2] = 48; //FIXME: match to slope vec3_t effectPos; VectorCopy( self->currentOrigin, effectPos ); effectPos[2] -= 15; G_PlayEffect( "explosions/droidexplosion1", effectPos ); // G_PlayEffect( "small_chunks", effectPos ); //set these to defaults that work in a worst-case scenario (according to current animation.cfg) gi.G2API_StopBoneAnimIndex( &self->ghoul2[self->playerModel], self->craniumBone ); misc_atst_setanim( self, self->rootBone, BOTH_DEATH1 ); } extern void G_DriveATST( gentity_t *ent, gentity_t *atst ); extern void SetClientViewAngle( gentity_t *ent, vec3_t angle ); extern qboolean PM_InSlopeAnim( int anim ); void misc_atst_use( gentity_t *self, gentity_t *other, gentity_t *activator ) { if ( !activator || activator->s.number ) {//only player can do this return; } int tempLocDmg[HL_MAX]; int hl, tempHealth; if ( activator->client->NPC_class != CLASS_ATST ) {//get in the ATST if ( activator->client->ps.groundEntityNum != self->s.number ) {//can only get in if on top of me... //we *could* even check for the hatch surf...? return; } //copy origin G_SetOrigin( activator, self->currentOrigin ); //copy angles VectorCopy( self->s.angles2, self->currentAngles ); G_SetAngles( activator, self->currentAngles ); SetClientViewAngle( activator, self->currentAngles ); //set player to my g2 instance gi.G2API_StopBoneAnimIndex( &self->ghoul2[self->playerModel], self->craniumBone ); G_DriveATST( activator, self ); activator->activator = self; self->s.eFlags |= EF_NODRAW; self->svFlags |= SVF_NOCLIENT; self->contents = 0; self->takedamage = qfalse; //transfer armor tempHealth = self->health; self->health = activator->client->ps.stats[STAT_ARMOR]; activator->client->ps.stats[STAT_ARMOR] = tempHealth; //transfer locationDamage for ( hl = HL_NONE; hl < HL_MAX; hl++ ) { tempLocDmg[hl] = activator->locationDamage[hl]; activator->locationDamage[hl] = self->locationDamage[hl]; self->locationDamage[hl] = tempLocDmg[hl]; } if ( !self->s.number ) { CG_CenterPrint( "@SP_INGAME_EXIT_VIEW", SCREEN_HEIGHT * 0.95 ); } } else {//get out of ATST int legsAnim = activator->client->ps.legsAnim; if ( legsAnim != BOTH_STAND1 && !PM_InSlopeAnim( legsAnim ) && legsAnim != BOTH_TURN_RIGHT1 && legsAnim != BOTH_TURN_LEFT1 ) {//can't get out of it while it's still moving return; } //FIXME: after a load/save, this crashes, BAD... somewhere in G2 G_SetOrigin( self, activator->currentOrigin ); VectorSet( self->currentAngles, 0, activator->client->ps.legsYaw, 0 ); //self->currentAngles[PITCH] = activator->currentAngles[ROLL] = 0; G_SetAngles( self, self->currentAngles ); VectorCopy( activator->currentAngles, self->s.angles2 ); //remove my G2 if ( self->playerModel >= 0 ) { gi.G2API_RemoveGhoul2Model( self->ghoul2, self->playerModel ); self->playerModel = -1; } //copy player's gi.G2API_CopyGhoul2Instance( activator->ghoul2, self->ghoul2, -1 ); self->playerModel = 0;//assumption //reset player to kyle G_DriveATST( activator, NULL ); activator->activator = NULL; self->s.eFlags &= ~EF_NODRAW; self->svFlags &= ~SVF_NOCLIENT; self->contents = CONTENTS_SOLID|CONTENTS_BODY|CONTENTS_MONSTERCLIP|CONTENTS_BOTCLIP; self->takedamage = qtrue; //transfer armor tempHealth = self->health; self->health = activator->client->ps.stats[STAT_ARMOR]; activator->client->ps.stats[STAT_ARMOR] = tempHealth; //transfer locationDamage for ( hl = HL_NONE; hl < HL_MAX; hl++ ) { tempLocDmg[hl] = self->locationDamage[hl]; self->locationDamage[hl] = activator->locationDamage[hl]; activator->locationDamage[hl] = tempLocDmg[hl]; } //link me back in gi.linkentity ( self ); //put activator on top of me? vec3_t newOrg = {activator->currentOrigin[0], activator->currentOrigin[1], activator->currentOrigin[2] + (self->maxs[2]-self->mins[2]) + 1 }; G_SetOrigin( activator, newOrg ); //open the hatch misc_atst_setanim( self, self->craniumBone, BOTH_STAND2 ); gi.G2API_SetSurfaceOnOff( &self->ghoul2[self->playerModel], "head_hatchcover", 0 ); G_Sound( self, G_SoundIndex( "sound/chars/atst/atst_hatch_open" )); } } void SP_misc_atst_drivable( gentity_t *ent ) { extern void NPC_ATST_Precache(void); extern void NPC_PrecacheAnimationCFG( const char *NPC_type ); ent->s.modelindex = G_ModelIndex( "models/players/atst/model.glm" ); ent->playerModel = gi.G2API_InitGhoul2Model( ent->ghoul2, "models/players/atst/model.glm", ent->s.modelindex, NULL_HANDLE, NULL_HANDLE, 0, 0 ); ent->rootBone = gi.G2API_GetBoneIndex( &ent->ghoul2[ent->playerModel], "model_root", qtrue ); ent->craniumBone = gi.G2API_GetBoneIndex( &ent->ghoul2[ent->playerModel], "cranium", qtrue ); //FIXME: need to somehow set the anim/frame to the equivalent of BOTH_STAND1... use to be that BOTH_STAND1 was the first frame of the glm, but not anymore ent->s.radius = 320; VectorSet( ent->s.modelScale, 1.0f, 1.0f, 1.0f ); //register my weapons, sounds and model RegisterItem( FindItemForWeapon( WP_ATST_MAIN )); //precache the weapon RegisterItem( FindItemForWeapon( WP_ATST_SIDE )); //precache the weapon //HACKHACKHACKTEMP - until ATST gets real weapons of it's own? RegisterItem( FindItemForWeapon( WP_EMPLACED_GUN )); //precache the weapon // RegisterItem( FindItemForWeapon( WP_ROCKET_LAUNCHER )); //precache the weapon // RegisterItem( FindItemForWeapon( WP_BOWCASTER )); //precache the weapon //HACKHACKHACKTEMP - until ATST gets real weapons of it's own? G_SoundIndex( "sound/chars/atst/atst_hatch_open" ); G_SoundIndex( "sound/chars/atst/atst_hatch_close" ); NPC_ATST_Precache(); ent->NPC_type = (char *)"atst"; NPC_PrecacheAnimationCFG( ent->NPC_type ); //open the hatch misc_atst_setanim( ent, ent->rootBone, BOTH_STAND2 ); gi.G2API_SetSurfaceOnOff( &ent->ghoul2[ent->playerModel], "head_hatchcover", 0 ); VectorSet( ent->mins, ATST_MINS0, ATST_MINS1, ATST_MINS2 ); VectorSet( ent->maxs, ATST_MAXS0, ATST_MAXS1, ATST_MAXS2 ); ent->contents = CONTENTS_SOLID|CONTENTS_BODY|CONTENTS_MONSTERCLIP|CONTENTS_BOTCLIP; ent->flags |= FL_SHIELDED; ent->takedamage = qtrue; if ( !ent->health ) { ent->health = 800; } ent->s.radius = 320; ent->max_health = ent->health; // cg_draw needs this G_SetOrigin( ent, ent->s.origin ); G_SetAngles( ent, ent->s.angles ); VectorCopy( ent->currentAngles, ent->s.angles2 ); gi.linkentity ( ent ); //FIXME: test the origin to make sure I'm clear? ent->e_UseFunc = useF_misc_atst_use; ent->svFlags |= SVF_PLAYER_USABLE; //make it able to take damage and die when you're not in it... //do an explosion and play the death anim, remove use func. ent->e_DieFunc = dieF_misc_atst_die; } on NPC.cpp is possible to find the functions that are activated when spawns droids classes case TEAM_ENEMY: // special cases for enemy droids switch( NPC->client->NPC_class) { case CLASS_ATST: NPC_BehaviorSet_ATST( bState ); return; case CLASS_PROBE: NPC_BehaviorSet_ImperialProbe(bState); return; case CLASS_REMOTE: NPC_BehaviorSet_Remote( bState ); return; case CLASS_SENTRY: NPC_BehaviorSet_Sentry(bState); return; case CLASS_INTERROGATOR: NPC_BehaviorSet_Interrogator( bState ); return; here maybe i can find something useful like explosion effect when ship "die" or other things related to moving, shielding etc. so, now i get the start points.
  11. Ehi!!! Now i figured also another important think! Have you present when you use noclip cheat and move the player forward in a certain diretion? maybe the noclip moving command can help me to figure out about how to autoforward the fighter, and boost up or stop!
  12. @@Ramikad not worry for gravity. doing the code for mist form spells for my LOK mod i discovered how to eliminate gravity effect on the player. is sufficient to apply that to all CLASS_FIGHTER class self->client->ps.gravity = 0; self->svFlags |= SVF_CUSTOM_GRAVITY; self->client->moveType = MT_FLYSWIM; this should fix the problem
  13. Also that is a nice solution... But i thinks shooting someone that leave the battle for cowardy, is against the moral codes of... well... i was figuring if i can do a conversion or some little game about the science fiction saga i worked on books for so many years. i doubt cranion alien race will be destroy a teammate because is leaving battle. they are too good (light side.)... sure skeelders will do that immediatly, instead. lol. however, nice solution too. thanks for suggest. now i check atst driveable on openjk and i see what happens.
  14. Lol... this is... unexpected XD. so it turn the ship but destroy the ship???? Oh lol XDD well now i see a lot inside the code what i find about that. should be really funny however "space battle more short of every time! Boom! "
  15. @@Noodle @@Ramikad many thanks for reply: rpg: i never think about use target level change for that. is a really nice idea. better than load a menu with icarus. my unique doubt is about how many menu can contain JKA regard that. (maybe there is some way for make a menu screen multiquest, like ingamemissionselect... atst drivable entity: i not thinked to that...nice idea! mmm i suppose is possible to copy the code of this for new fighter AI and setting the movement studing movement of probe \ sentry \ seeker droids. the baddest thing is to force the fighter to go EVER on forward after it start to flight. for landing \ flying also AI of rockettrooper can be useful. i figured also how avoid eventually crash on skybox: trigger teleports around the map can avoid that. if a fighter is too close of the edge of map. will be teleported into a safe position
  16. sure. now i am doing some modelling attempting, but after i think i will try to do a fighter class AI for NPC, simply because i see vehicles fighters are not much good to drive into JKA (i tested to fly with a tie fighter yesterday on taspir1, midgar_v3 and t2_trip map... i Never Seen a game when happen something so silly like a fighter that crash when hit the skybox XD... also i see that by camera view back of fighter is pratically impossible to see the laser shoot of tie. so, i think is better to create a NPC class (that works also for playermodels ) that can be used for rigged glm fighter model, instead of fighter vehicle. also because something like that can really get at disposition a large amount of weapons. droids classes sure will be useful. for command interface i think i will see the fighter vehicle commands. About Rpg: i did a test editing script of t1_fatal. i see is possible with icarus to call a menu screen by ingame and for return ingame thhe menu need to contain "uiscript closedatapad" as command. i supose is possible to create a huge map of some kind of action rpg style with NPC setted in stand position and SET_INVINCIBLE on spawnscript that can be "usable" and when player use appear menu with briefing of the quest. when player esc by menu, appear the quest into objective of mission. the reward should be a strong weapon or a force power updgrade... theorically this can works fine. (pity i cannot see mp code of siege_destroyer and asteroids mp maps about HUD cockpit and vehicle coding of fighters... should be really helpful for figure how to do this fighter class thing. ) Ah, i have a little secondaty question: i wanna try gtk radiant 1.6 but i get error to start up it also with XP supported version here on openjk... i suppose need visual studio 2011. i have 2010... there is not some early version of gtk radiant 1.6.0 with no silly request about visual studio or net frameworks, OS etc? i looked also for NetRadiant , i see is very powerful: at moment developer of 3d remake of blood omen (blood omnicide) build up HD maps with net radiant. prodigious! ... but i see Net Radiant haven't any support for JKA and i cannot figured how to make it possible. pity.
  17. I now JKA is substancially an FPS with a spectacular saber combat system, but i was wonderfing if there is the possibility for the Single Player Game to allow also other type of gameplay. there is some project of multiplayer with RPG game code modification with a system of levelling \ skilling \ quest dispatching \ briefing \ rewarding that can be studied for be ported or created some SP version? Also for space flight battle with vehicles fighters. i see in the recently asteroid maps there is some edit fo MP Clients in the pk3 of the map. i was wondering if there something that can help to imprement vehicle moving on Single player for do a nice space battle fight FPS . otherwise, if there is some way for create a new NPC class for FIGHTERS (i suppose that in that case will be more easy if NPC have custom rig \ skeleton \ weapons and class code that allow to have multiple blaster \ seeker weapons etc). (sure a "fighter" npc in that case cannot use force powers so it reqjuire also a force power restriction, a custom HUD weapon selects, and the possibiluty of moving the NPC ever in auto fast forward moving. (like afighter) ... maybe doing a new king of "droid" class coded modded for the evenience? Sorry if i ask these questions.
  18. Oh, many thanks @@Circa
  19. Sorry for question. i am searching the map of this video. someone have or can link me to an active download? https://www.youtube.com/watch?v=elmOHdZOGT4
  20. Sorry i am a SP modder \ coder so i have not familiar with MP. so i cannot help you. I fear however that is coded. i fear the unique way to do that, is to download ja++ source code, find the code blocks that allow that, paste into a your version of open jk code, and build MP client.
  21. let me understand. is a custom character menu file \ screen with a button that allow to scroll up all characters available on models directory, or is the character selection for player at the start of game?
  22. Sure. If you check the escape from yavin 4 the lost maps mod, and you see the menu files about characters.menu, you will see how properly work this feature. example of displaying model item menu: itemDef { name character group models type ITEM_TYPE_MODEL rect 360 84 300 340 model_g2anim "BOTH_WALK1" asset_model "ui_char_model" model_angle 180 model_g2mins -10 -15 -10 model_g2maxs 20 15 30 model_rotation 28 model_fovx 50 model_fovy 55 isCharacter 1 visible 1 decoration } this NEED to be called by an interactive text button, like that: // RESPEN itemDef { name RESPEN group friends style WINDOW_STYLE_EMPTY type ITEM_TYPE_BUTTON rect 180 100 100 15 text "Respen" descText " " font 3 textscale .75 textaligny 0 textalign ITEM_ALIGN_LEFT textstyle 1 textalignx 0 forecolor 1 .682 0 1 visible 0 mouseEnter { show button_glow setitemrect button_glow 160 100 150 12 setcvar "ui_char_model" Respen uiScript "characterchanged" uiScript "resetcharacterlistboxes" setcvar "UI_HOME" "Villaggio sconosciuto" setcvar "UI_RACE" "Mietitore" setcvar "UI_POSITION" "Guardiano della Mente" setcvar "UI_HEALTH" "2000" setcvar "UI_FORCE" "200" setcvar "UI_STRENGTHS" "Conoscenze Arcane. Volontà Ferrea, Telepatia." setcvar "UI_WEAKNESSES" "Nessuna nota." setcvar "UI_WEAPON_PREF" "Mietitrice d'Aria." show information setcvar "UI_INFO" @CHARS_RESPENSTATUS } mouseExit { hide button_glow uiScript "characterchanged" uiScript "resetcharacterlistboxes" } action { setcvar tier_mapname "maptransition level0" play "sound/weapons/Air_Reaver/airreaver1.mp3"; close all open respenstory } } example by character menu of my mod, based on character menu of ey4
  23. me too ever seen a black box in emitters md3 attached model. i fear is the program, there nothing to do. effect ed cannot render a model. effect editor is not a nice effect editor, but is ever better that write with hand on notepad. also effect editor is hateful because cannot reproduce md3 sounds of effect but only wav formats and cannot process some kind of shaders -,- another hateful think is realted to md3 emitter too: is impossible to see in program with this stupid blackbox, if the emitted model is corrected aligned. i did an effect of throwed knives in past and i become madness for put knifes md3 models into projectile in the correct position and angle.
  24. 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 );
  25. in AI_bobafett about boba_flying function there are specified setted hardcoded field about the start of jetpack effect when start to fly and stop jetpack effect when landing and boost off jetpack (i have not again found where in the code is the disapperaing of effect when rockettroooper die)
×
×
  • Create New...