-
Posts
2,023 -
Joined
-
Last visited
Content Type
News Articles
Tutorials
Forums
Downloads
Everything posted by Asgarath83
-
Well, i am not a script expert. maybe @@therfiles know if there is something about that. he's a good scripter. for entmodding, i wanna suggest to you to add NPC_spawner entity to the map and set the count to -1 like the NPC_spawner of the rancor into the t2_rancor map. if you kill the rancor in this map it spawn again at infinite. XD you need to make something like this rancor spawner.
-
mmm, interessing. for my code stuff i removed the restriction that avoid to saberist to be mindtricked, stunned or charmed. o.o i discovered an important issue: for saberist the confusion power expire without trouble, but charming no. if a saberist switch to team_player it never return to team_enemy D: i pass the last days become crazy because charming code of FP_HATE never expired and now i discover that work only with no-saberist. with saberist the switching team never expired with the end of force power. o.o
-
well, i got some trouble with "not secure connection" issue when i go to firefox site to download the last version. i have windows XPSP3 As Os, simply because i not like much the UI of windows 7 and in past i had 7 but i got troubles and i was formatted the computer. strangely, the last time i watched a repository into Git, some month ago, the site wors fine. i have installed ne w version of java and silverlight just now, but trouble is not fixed. i not use windows firewall, my antivirus is nod32.
-
i used gmail.com . is supported by git? i receive the verification email but when i click on confirm box or go to the link it ever resend to me to a page like this screenshot: http://postimg.org/image/gnsyhudyl/ i have firefox as browser. on Internet explorer, git is down and IE cannot open. the problem there is also today. if you see, there is something of strange. i have a wrong view of the site. skin and template is missing.
-
I think for freeze i will make an hybric think between force grip level 1 and fp_telepathy level 1-2. now i print the two code for see how can i proceed. grip code is pretty hard because is separate in many parts. functions of grips are into void forcegrip, and also into forcepowerstart, forcepowerstop and forcepowerrun. o.o
-
Well my project at moment is almost private. this is the region i never show here screenshot of WIP related to this. it's a think between me and some of my italian friend. the rem lines of the code contains some annotation related to the power of the rpg characters of my friends. if i need to host on JKhub, i need to remove all voice related to that. Okay my mod is like fantasy kind, but it's on legacy of kain, not about harry potter LOL. avada kevadra and fireballs there are already and they are the blaster projectile and the concussion alt fire projectile efx, that i make as a green ray with a skull that is letal on impact to all human and mortal creature because it does an HUGE amount of dmg. force wave: there is already with the fire glyph of soul reaver, is simply a saber file special edited with knockback, kata animation and shockwave efx. i make also a tutorial about making a sab like this. can you do also by your hand force black magic: it's simply a force grip with a chest efx like the force rage and the animation PULLED_IN_AIR_F . i edited a lot the grip for making the telekinesis grip of Defiance of Kain. but the result is pretty similar. i need just to fix the animation and add a chestbolt efx. force Yoddle: are seriously? XD Lol, i get a Sound stunning Glyph as saber. if you replace the sound of hitothereffects with your song you obtain already this. XD
-
Yes you're right. also if is private, a depository should be really a good idea. i am little tired of bugs that appear unexpected after a lot of code edit. so i cannot understand what exaclty cause it. tomorrow i will register to Git so i can trace better my code edit of JKA. Now i need to go. it's late. goodnight ensy However, yes, i am learning also because every time i not understand what i see, i ever go to check the definition or i dive the code for searching the origin void of a function for understand exactly what is called.
-
Yes, before of adding the force power in the specific if \ else field i tryed this way, but unlucky because need a large amount of code arrangement. also, i am again a beginner, and clientthink is a very complex function. it's a core function of the game so i prefear not make too much big edit on the code adding to much unnecessary stuff if is not really necessary now i need to fix only two things: 1: end force freeze power, that freeze movement and animation of NPC affected for his duraction. any idea, @@Stoiss ? fixing the strange issue i got know with FP_FREEZE, GRIP and CONTROLMIND power level reroll to 1 when i use then.
-
mmm well well yes, now is missing only the freezing of force stasys. not an easy thing to do. however i got a little trouble: when i use some force power setted to level 2 or 3, they get automatically reroll to level 1. this affected: FP_CONTROLMIND FP_FREEZE and, strangely, FP_GRIP. Sure it's some strange edit i maked. at moment i was focused to making these force powers, so i have not really a good idea about fixing this big issue. :\ Edit: i found a trace: FP_FREEZE downgrade automatically to level 1 after cast efx will end. FP_GRIP and CONTROLMIND instead, downgrade immediatly. maybe there is some connection.
-
Found the dependece in clientthink function, but is deep inside, into the core of the code. Clientthink is a function too much important and too much things depend on it. edit function or make a new "clientthink2" function only for a force power is not really a good solution. i wanna try with this edit: void ClientThink( int clientNum, usercmd_t *ucmd ) { gentity_t *ent; qboolean restore_ucmd = qfalse; usercmd_t sav_ucmd = {0}; ent = g_entities + clientNum; if ( ent->s.number<MAX_CLIENTS ) { if ( ent->client->ps.viewEntity > 0 && ent->client->ps.viewEntity < ENTITYNUM_WORLD ) {//you're controlling another NPC gentity_t *controlled = &g_entities[ent->client->ps.viewEntity]; qboolean freed = qfalse; if ( controlled->NPC && controlled->NPC->controlledTime && ent->client->ps.forcePowerLevel[FP_TELEPATHY] > FORCE_LEVEL_3 || controlled->NPC && controlled->NPC->controlledTime && ent->client->ps.forcePowerLevel[FP_CONTROLMIND] > FORCE_LEVEL_0 ) {//An NPC I'm controlling with mind trick if ( controlled->NPC->controlledTime < level.time ) {//time's up! G_ClearViewEntity( ent ); freed = qtrue; } else if ( ucmd->upmove > 0 ) {//jumping gets you out of it FIXME: check some other button instead... like ESCAPE... so you could even have total control over an NPC? G_ClearViewEntity( ent ); ucmd->upmove = 0;//ucmd->buttons = 0; //stop player from doing anything for a half second after ent->aimDebounceTime = level.time + 500; freed = qtrue; } } else if ( controlled->client //an NPC && PM_GentCantJump( controlled ) //that cannot jump && controlled->client->moveType != MT_FLYSWIM ) //and does not use upmove to fly {//these types use jump to get out if ( ucmd->upmove > 0 ) {//jumping gets you out of it FIXME: check some other button instead... like ESCAPE... so you could even have total control over an NPC? G_ClearViewEntity( ent ); ucmd->upmove = 0;//ucmd->buttons = 0; //stop player from doing anything for a half second after ent->aimDebounceTime = level.time + 500; freed = qtrue; } } if ( !freed ) {//still controlling, save off my ucmd and clear it for my actual run through pmove restore_ucmd = qtrue; memcpy( &sav_ucmd, ucmd, sizeof( usercmd_t ) ); memset( ucmd, 0, sizeof( usercmd_t ) ); //to keep pointing in same dir, need to set ucmd->angles ucmd->angles[PITCH] = ANGLE2SHORT( ent->client->ps.viewangles[PITCH] ) - ent->client->ps.delta_angles[PITCH]; ucmd->angles[YAW] = ANGLE2SHORT( ent->client->ps.viewangles[YAW] ) - ent->client->ps.delta_angles[YAW]; ucmd->angles[ROLL] = 0; if ( controlled->NPC ) { VectorClear( controlled->client->ps.moveDir ); controlled->client->ps.speed = (sav_ucmd.buttons&BUTTON_WALKING)?controlled->NPC->stats.walkSpeed:controlled->NPC->stats.runSpeed; } } else { ucmd->angles[PITCH] = ANGLE2SHORT( ent->client->ps.viewangles[PITCH] ) - ent->client->ps.delta_angles[PITCH]; ucmd->angles[YAW] = ANGLE2SHORT( ent->client->ps.viewangles[YAW] ) - ent->client->ps.delta_angles[YAW]; ucmd->angles[ROLL] = 0; } } else if ( ent->client->NPC_class == CLASS_ATST ) { if ( ucmd->upmove > 0 ) {//get out of ATST GEntity_UseFunc( ent->activator, ent, ent ); ucmd->upmove = 0;//ucmd->buttons = 0; } } PM_CheckForceUseButton( ent, ucmd ); } Vehicle_t *pVeh = NULL; // Rider logic. // NOTE: Maybe this should be extracted into a RiderUpdate() within the vehicle. if ( ( pVeh = G_IsRidingVehicle( ent ) ) != 0 ) { // If we're still in the vehicle... if ( pVeh->m_pVehicleInfo->UpdateRider( pVeh, ent, ucmd ) ) { restore_ucmd = qtrue; memcpy( &sav_ucmd, ucmd, sizeof( usercmd_t ) ); memset( ucmd, 0, sizeof( usercmd_t ) ); //to keep pointing in same dir, need to set ucmd->angles //ucmd->angles[PITCH] = ANGLE2SHORT( ent->client->ps.viewangles[PITCH] ) - ent->client->ps.delta_angles[PITCH]; //ucmd->angles[YAW] = ANGLE2SHORT( ent->client->ps.viewangles[YAW] ) - ent->client->ps.delta_angles[YAW]; //ucmd->angles[ROLL] = 0; ucmd->angles[PITCH] = sav_ucmd.angles[PITCH]; ucmd->angles[YAW] = sav_ucmd.angles[YAW]; ucmd->angles[ROLL] = sav_ucmd.angles[ROLL]; //if ( sav_ucmd.weapon != ent->client->ps.weapon && PM_WeaponOkOnVehicle( sav_ucmd.weapon ) ) {//trying to change weapons to a valid weapon for this vehicle, to preserve this weapon change command ucmd->weapon = sav_ucmd.weapon; } //else {//keep our current weapon // ucmd->weapon = ent->client->ps.weapon; // if ( ent->client->ps.weapon != WP_NONE ) {//not changing weapons and we are using one of our weapons, not using vehicle weapon //so we actually want to do our fire weapon on us, not the vehicle ucmd->buttons = (sav_ucmd.buttons&(BUTTON_ATTACK|BUTTON_ALT_ATTACK)); // sav_ucmd.buttons &= ~ucmd->buttons; } } } } ent->client->usercmd = *ucmd; // if ( !g_syncronousClients->integer ) { ClientThink_real( ent, ucmd ); } // If a vehicle, make sure to attach our driver and passengers here (after we pmove, which is done in Think_Real)) if ( ent->client && ent->client->NPC_class == CLASS_VEHICLE ) { pVeh = ent->m_pVehicle; pVeh->m_pVehicleInfo->AttachRiders( pVeh ); } // ClientThink_real can end up freeing this ent, need to check if ( restore_ucmd && ent->client ) {//restore ucmd for later so NPC you're controlling can refer to them memcpy( &ent->client->usercmd, &sav_ucmd, sizeof( usercmd_t ) ); } if ( ent->s.number ) {//NPCs drown, burn from lava, etc, also P_WorldEffects( ent ); } } Should work with the two powers, not only with FP_MINDTRICK level 4. now i will test. : AH YES! IT WORKS! YEAAH! Now i need just to end the forcefreeze!
-
Oh lol, there is some strange dependence. jump exit work if i use FP_CONTROLMIND liv 1,2,3 whatever i want and possess an enemy. IF also FP_MINDTRICK is setted on level 4 D: there is some odd connection between the two powers. well i am in the right way. i need just to create the some functions net for FP_CONTROLMIND for separate the two powers definitely.
-
The Force Awakens Conversion Mod for SP
Asgarath83 replied to GPChannel's topic in WIPs, Teasers & Releases
Oh my, before plannin anything, wait a lot! the movie go to cinema the next months -
@@Ramikad seems i found the solution of controlmind i need to add an if here for my new power. g_active.cpp void ClientThink( int clientNum, usercmd_t *ucmd ) { gentity_t *ent; qboolean restore_ucmd = qfalse; usercmd_t sav_ucmd = {0}; ent = g_entities + clientNum; if ( ent->s.number<MAX_CLIENTS ) { if ( ent->client->ps.viewEntity > 0 && ent->client->ps.viewEntity < ENTITYNUM_WORLD ) {//you're controlling another NPC gentity_t *controlled = &g_entities[ent->client->ps.viewEntity]; qboolean freed = qfalse; if ( controlled->NPC && controlled->NPC->controlledTime && ent->client->ps.forcePowerLevel[FP_TELEPATHY] > FORCE_LEVEL_3 ) {//An NPC I'm controlling with mind trick if ( controlled->NPC->controlledTime < level.time ) {//time's up! G_ClearViewEntity( ent ); freed = qtrue; } else if ( ucmd->upmove > 0 ) {//jumping gets you out of it FIXME: check some other button instead... like ESCAPE... so you could even have total control over an NPC? G_ClearViewEntity( ent ); ucmd->upmove = 0;//ucmd->buttons = 0; //stop player from doing anything for a half second after ent->aimDebounceTime = level.time + 500; freed = qtrue; } } else if ( controlled->client //an NPC && PM_GentCantJump( controlled ) //that cannot jump && controlled->client->moveType != MT_FLYSWIM ) //and does not use upmove to fly {//these types use jump to get out if ( ucmd->upmove > 0 ) {//jumping gets you out of it FIXME: check some other button instead... like ESCAPE... so you could even have total control over an NPC? G_ClearViewEntity( ent ); ucmd->upmove = 0;//ucmd->buttons = 0; //stop player from doing anything for a half second after ent->aimDebounceTime = level.time + 500; freed = qtrue; } } if ( !freed ) {//still controlling, save off my ucmd and clear it for my actual run through pmove restore_ucmd = qtrue; memcpy( &sav_ucmd, ucmd, sizeof( usercmd_t ) ); memset( ucmd, 0, sizeof( usercmd_t ) ); //to keep pointing in same dir, need to set ucmd->angles ucmd->angles[PITCH] = ANGLE2SHORT( ent->client->ps.viewangles[PITCH] ) - ent->client->ps.delta_angles[PITCH]; ucmd->angles[YAW] = ANGLE2SHORT( ent->client->ps.viewangles[YAW] ) - ent->client->ps.delta_angles[YAW]; ucmd->angles[ROLL] = 0; if ( controlled->NPC ) { VectorClear( controlled->client->ps.moveDir ); controlled->client->ps.speed = (sav_ucmd.buttons&BUTTON_WALKING)?controlled->NPC->stats.walkSpeed:controlled->NPC->stats.runSpeed; } } else { ucmd->angles[PITCH] = ANGLE2SHORT( ent->client->ps.viewangles[PITCH] ) - ent->client->ps.delta_angles[PITCH]; ucmd->angles[YAW] = ANGLE2SHORT( ent->client->ps.viewangles[YAW] ) - ent->client->ps.delta_angles[YAW]; ucmd->angles[ROLL] = 0; } }
-
@@Ramikad found something pretty interessing. i think i need to work on this for end the controlmind code. D: wp_saber.cpp qboolean WP_CheckBreakControl( gentity_t *self ) { if ( !self ) { return qfalse; } if ( !self->s.number ) {//player if ( self->client && self->client->ps.forcePowerLevel[FP_TELEPATHY] > FORCE_LEVEL_3 ) {//control-level if ( self->client->ps.viewEntity > 0 && self->client->ps.viewEntity < ENTITYNUM_WORLD ) {//we are in a viewentity gentity_t *controlled = &g_entities[self->client->ps.viewEntity]; if ( controlled->NPC && controlled->NPC->controlledTime > level.time ) {//it is an NPC we controlled //clear it and return G_ClearViewEntity( self ); return qtrue; } } } } else {//NPC if ( self->NPC && self->NPC->controlledTime > level.time ) {//being controlled gentity_t *controller = &g_entities[0]; if ( controller->client && controller->client->ps.viewEntity == self->s.number ) {//we are being controlled by player if ( controller->client->ps.forcePowerLevel[FP_TELEPATHY] > FORCE_LEVEL_3 ) {//control-level mind trick //clear the control and return G_ClearViewEntity( controller ); return qtrue; } } } } return qfalse; } lol it was under my nose. i need to make the same thing for force controlmind
-
@@Ramikad yes i know, also with jump button you can escape from control modality. but on the void forcetelepathy there is only this related to control mind: else if ( self->client->ps.forcePowerLevel[FP_TELEPATHY] > FORCE_LEVEL_3 ) {//control them, even jedi G_SetViewEntity( self, traceEnt ); traceEnt->NPC->controlledTime = level.time + 30000; } G_SetViewEntity is the key, but if you put in another code part or in another force power, these never expired and jump escape not work. i really not know how to fix this. i am again a beginner as coder. the function G_SetViewEntity is programmed on g_active.cpp void G_SetViewEntity( gentity_t *self, gentity_t *viewEntity ) { if ( !self || !self->client || !viewEntity ) { return; } if ( self->s.number == 0 && cg.zoomMode ) { // yeah, it should really toggle them so it plays the end sound.... cg.zoomMode = 0; } if ( viewEntity->s.number == self->client->ps.viewEntity ) { return; } //clear old one first G_ClearViewEntity( self ); //set new one self->client->ps.viewEntity = viewEntity->s.number; viewEntity->svFlags |= SVF_BROADCAST; //remember current angles VectorCopy( self->client->ps.viewangles, self->pos4 ); if ( viewEntity->client ) { //vec3_t clear = {0,0,0}; CG_SetClientViewAngles( viewEntity->client->ps.viewangles, qtrue ); //SetClientViewAngle( self, viewEntity->client->ps.viewangles ); //SetClientViewAngle( viewEntity, clear ); /* VectorCopy( viewEntity->client->ps.viewangles, self->client->ps.viewangles ); for ( int i = 0; i < 3; i++ ) { self->client->ps.delta_angles[i] = viewEntity->client->ps.delta_angles[i]; } */ } if ( !self->s.number ) { CG_CenterPrint( "@SP_INGAME_EXIT_VIEW", SCREEN_HEIGHT * 0.95 ); } } but they are view and camera setting, there is nothing about escape buttons or expiring. o.o i think expiring is setted by that: traceEnt->NPC->controlledTime = level.time + 30000; maybe i need to check the controlledTime function
-
mmmm, i am thinking that the "press jump to escape" function is strongly hardcoded only for level 4 of mindtrick and so not work in other force power or with other force power level. D: i need to investigate about this for discover where is the trick. thanks for hint. okay if power is not expiring... but almost a escape function is necessary. for the rest the force control is perfect. it work also with saberist XD controlling is enable by the function G_SetViewEntity this function is programmed into g_active.cpp extern void CG_SetClientViewAngles( vec3_t angles, qboolean overrideViewEnt ); qboolean G_ClearViewEntity( gentity_t *ent ) { if ( !ent->client->ps.viewEntity ) return qfalse; if ( ent->client->ps.viewEntity > 0 && ent->client->ps.viewEntity < ENTITYNUM_NONE ) { if ( &g_entities[ent->client->ps.viewEntity] ) { g_entities[ent->client->ps.viewEntity].svFlags &= ~SVF_BROADCAST; if ( g_entities[ent->client->ps.viewEntity].NPC ) { g_entities[ent->client->ps.viewEntity].NPC->controlledTime = 0; SetClientViewAngle( &g_entities[ent->client->ps.viewEntity], g_entities[ent->client->ps.viewEntity].currentAngles ); G_SetAngles( &g_entities[ent->client->ps.viewEntity], g_entities[ent->client->ps.viewEntity].currentAngles ); VectorCopy( g_entities[ent->client->ps.viewEntity].currentAngles, g_entities[ent->client->ps.viewEntity].NPC->lastPathAngles ); g_entities[ent->client->ps.viewEntity].NPC->desiredYaw = g_entities[ent->client->ps.viewEntity].currentAngles[YAW]; } } CG_SetClientViewAngles( ent->pos4, qtrue ); SetClientViewAngle( ent, ent->pos4 ); } ent->client->ps.viewEntity = 0; return qtrue; } void G_SetViewEntity( gentity_t *self, gentity_t *viewEntity ) { if ( !self || !self->client || !viewEntity ) { return; } if ( self->s.number == 0 && cg.zoomMode ) { // yeah, it should really toggle them so it plays the end sound.... cg.zoomMode = 0; } if ( viewEntity->s.number == self->client->ps.viewEntity ) { return; } //clear old one first G_ClearViewEntity( self ); //set new one self->client->ps.viewEntity = viewEntity->s.number; viewEntity->svFlags |= SVF_BROADCAST; //remember current angles VectorCopy( self->client->ps.viewangles, self->pos4 ); if ( viewEntity->client ) { //vec3_t clear = {0,0,0}; CG_SetClientViewAngles( viewEntity->client->ps.viewangles, qtrue ); //SetClientViewAngle( self, viewEntity->client->ps.viewangles ); //SetClientViewAngle( viewEntity, clear ); /* VectorCopy( viewEntity->client->ps.viewangles, self->client->ps.viewangles ); for ( int i = 0; i < 3; i++ ) { self->client->ps.delta_angles[i] = viewEntity->client->ps.delta_angles[i]; } */ } if ( !self->s.number ) { CG_CenterPrint( "@SP_INGAME_EXIT_VIEW", SCREEN_HEIGHT * 0.95 ); } } qboolean G_ControlledByPlayer( gentity_t *self ) { if ( self && self->NPC && self->NPC->controlledTime > level.time ) {//being controlled gentity_t *controller = &g_entities[0]; if ( controller->client && controller->client->ps.viewEntity == self->s.number ) {//we're the player's viewEntity return qtrue; } } return qfalse; } i need to study this >.<
-
@@Ramikad thanks for hints. tomorrow i will give a look. yes, also for the force throw i need to examinate better. my main problem now is to find almost a way to esc for the force control mind. XD if not, the only method is to be slay by enemies or to suicide the NPC. XD really funny but can give some trouble in some map if there aren't enemies and trigger_hurt
-
@@Noodle @@ensiform void ForceControlMind( gentity_t *self ) { trace_t tr; vec3_t end, forward; gentity_t *traceEnt; qboolean targetLive = qfalse; if ( WP_CheckBreakControl( self ) ) { return; } if ( self->health <= 0 ) { return; } //FIXME: if mind trick 3 and aiming at an enemy need more force power if ( !WP_ForcePowerUsable( self, FP_CONTROLMIND, 0 ) ) { return; } if ( self->client->ps.weaponTime >= 800 ) {//just did one! return; } if ( self->client->ps.saberLockTime > level.time ) {//FIXME: can this be a way to break out? return; } AngleVectors( self->client->ps.viewangles, forward, NULL, NULL ); VectorNormalize( forward ); VectorMA( self->client->renderInfo.headPoint, 2048, forward, end ); //Cause a distraction if enemy is not fighting gi.trace( &tr, self->client->renderInfo.torsoPoint, vec3_origin, vec3_origin, end, self->s.number, MASK_OPAQUE|CONTENTS_BODY, (EG2_Collision)0, 0 ); if ( tr.entityNum == ENTITYNUM_NONE || tr.fraction == 1.0 || tr.allsolid || tr.startsolid ) { return; } traceEnt = &g_entities[tr.entityNum]; if( traceEnt->NPC && traceEnt->NPC->scriptFlags & SCF_NO_FORCE ) { return; } if ( traceEnt && traceEnt->client ) { switch ( traceEnt->client->NPC_class ) { // CLASS CANNOT BE DOMINATED case CLASS_GALAKMECH: case CLASS_ATST: case CLASS_SAND_CREATURE: case CLASS_TAVION: case CLASS_DESANN: case CLASS_JAN: case CLASS_GALAK: case CLASS_LIZARD: case CLASS_MURJJ: case CLASS_FLIER2: case CLASS_GLIDER: case CLASS_FISH: case CLASS_CLAW: case CLASS_REBORN: case CLASS_JEDI: case CLASS_ALORA: case CLASS_MORGANKATARN: case CLASS_WAMPA: case CLASS_MINEMONSTER: case CLASS_KYLE: case CLASS_LUKE: case CLASS_SHADOWTROOPER: case CLASS_LANDO: case CLASS_BARTENDER: case CLASS_UGNAUGHT: case CLASS_WEEQUAY: case CLASS_NOGHRI: case CLASS_TUSKEN: case CLASS_SWAMPTROOPER: case CLASS_GRAN: case CLASS_BESPIN_COP: case CLASS_SABOTEUR: case CLASS_HAZARD_TROOPER: case CLASS_ROCKETTROOPER: case CLASS_REBEL: case CLASS_PROBE: //no droids either case CLASS_GONK: case CLASS_R2D2: case CLASS_MARK1: case CLASS_MARK2: case CLASS_MOUSE: case CLASS_JAWA: case CLASS_HOWLER: case CLASS_SEEKER: case CLASS_SENTRY: case CLASS_REMOTE: case CLASS_PROTOCOL: case CLASS_ASSASSIN_DROID: case CLASS_SABER_DROID: case CLASS_BOBAFETT: // you wanna to control galesh and arcidemon? Just try! // tutti gli elementali e i boss non posson esser stunnati! break; case CLASS_RANCOR: if ( !(traceEnt->spawnflags&1) ) { targetLive = qtrue; } break; default: targetLive = qtrue; break; } } if ( targetLive && traceEnt->NPC && traceEnt->health > 0 ) {//hit an organic non-player if ( G_ActivateBehavior( traceEnt, BSET_MINDTRICK ) ) {//activated a script on him //FIXME: do the visual sparkles effect on their heads, still? WP_ForcePowerStart( self, FP_CONTROLMIND, 0 ); } else if ( traceEnt->client->playerTeam != self->client->playerTeam ) {//an enemy int override = 0; if ( (traceEnt->NPC->scriptFlags&SCF_NO_MIND_TRICK) ) { if ( traceEnt->client->NPC_class == CLASS_GALAKMECH ) { G_AddVoiceEvent( traceEnt, Q_irand( EV_CONFUSE1, EV_CONFUSE3 ), Q_irand( 3000, 5000 ) ); } } else if ( self->client->ps.forcePowerLevel[FP_CONTROLMIND] > FORCE_LEVEL_3 ) {//control them, even jedi G_SetViewEntity( self, traceEnt ); traceEnt->NPC->controlledTime = level.time + 30000; } else if ( /*traceEnt->s.weapon != WP_SABER &&*/ traceEnt->client->NPC_class != CLASS_REBORN ) {//haha! Jedi aren't easily confused! if ( self->client->ps.forcePowerLevel[FP_CONTROLMIND] < FORCE_LEVEL_3 && traceEnt->s.weapon != WP_NONE //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them /*&& traceEnt->client->NPC_class != CLASS_TUSKEN//don't charm them, just confuse them && traceEnt->client->NPC_class != CLASS_NOGHRI//don't charm them, just confuse them*/ && !Pilot_AnyVehiclesRegistered() //also, don't charm guys when bikes are near ) {//turn them to our side //if mind trick 3 and aiming at an enemy need more force power override = 50; if ( self->client->ps.forcePower < 50 ) { return; } if ( traceEnt->enemy ) { G_ClearEnemy( traceEnt ); } if ( traceEnt->NPC ) { traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL; } //FIXME: maybe pick an enemy right here? //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!! team_t saveTeam = traceEnt->client->enemyTeam; traceEnt->client->enemyTeam = traceEnt->client->playerTeam; traceEnt->client->playerTeam = saveTeam; G_SetViewEntity( self, traceEnt ); //FIXME: need a *charmed* timer on this...? Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done? traceEnt->NPC->confusionTime = level.time + ControlMindTime[self->client->ps.forcePowerLevel[FP_CONTROLMIND]]; if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 ) {//FIXME: what if already playing effect? G_PlayEffect( G_EffectIndex( "force/wrack" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, ControlMindTime[self->client->ps.forcePowerLevel[FP_CONTROLMIND]], qtrue ); G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/charm.mp3" ); } /*if ( self->client->ps.forcePowerLevel[FP_CONTROLMIND] = FORCE_LEVEL_1 && traceEnt->NPC->controlledTime > 20000) //traceEnt->client->ps.pm_type < PM_DEAD && traceEnt->NPC!=NULL && !(traceEnt->NPC->scriptFlags&SCF_NO_RESPONSE) ) { NPC_UseResponse( traceEnt, self, qfalse ); WP_ForcePowerStart( self, FP_CONTROLMIND, 1 ); G_SetViewEntity( self, player ); }*/ /*if ( self->client->ps.forcePowerLevel[FP_CONTROLMIND] = FORCE_LEVEL_2 && traceEnt->NPC->controlledTime > 40000) //traceEnt->client->ps.pm_type < PM_DEAD && traceEnt->NPC!=NULL && !(traceEnt->NPC->scriptFlags&SCF_NO_RESPONSE) ) { NPC_UseResponse( traceEnt, self, qfalse ); WP_ForcePowerStart( self, FP_CONTROLMIND, 1 ); G_SetViewEntity( self, player ); }*/ } else {//enemy will not attack at this control mind mastery //somehow confuse them? Set don't fire to true for a while? Drop their aggression? Maybe just take their enemy away and don't let them pick one up for a while unless shot? if ( self->client->ps.forcePower < 90 ) { return; } if ( traceEnt->enemy ) { G_ClearEnemy( traceEnt ); } if ( traceEnt->NPC ) { traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL; } team_t saveTeam = traceEnt->client->enemyTeam; traceEnt->client->enemyTeam = traceEnt->client->playerTeam; traceEnt->client->playerTeam = saveTeam; G_SetViewEntity( self, traceEnt ); traceEnt->NPC->confusionTime = level.time + ControlMindTime[self->client->ps.forcePowerLevel[FP_CONTROLMIND]];//confused for about 10 seconds if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 ) {//FIXME: what if already playing effect? G_PlayEffect( G_EffectIndex( "force/wrack" ), traceEnt->playerModel, traceEnt->chestBolt, traceEnt->s.number, traceEnt->currentOrigin, FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]], qtrue ); G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/charm.mp3" ); } /*if ( self->client->ps.forcePowerLevel[FP_CONTROLMIND] = FORCE_LEVEL_3 && traceEnt->NPC->controlledTime > 60000) //traceEnt->client->ps.pm_type < PM_DEAD && traceEnt->NPC!=NULL && !(traceEnt->NPC->scriptFlags&SCF_NO_RESPONSE) ) { NPC_UseResponse( traceEnt, self, qfalse ); WP_ForcePowerStart( self, FP_CONTROLMIND, 1 ); G_SetViewEntity( self, player ); }*/ } } else { NPC_Jedi_PlayConfusionSound( traceEnt ); } WP_ForcePowerStart( self, FP_CONTROLMIND, override ); } else if ( traceEnt->client->playerTeam == self->client->playerTeam ) {//an ally //maybe just have him look at you? Respond? Take your enemy? if ( traceEnt->client->ps.pm_type < PM_DEAD && traceEnt->NPC!=NULL && !(traceEnt->NPC->scriptFlags&SCF_NO_RESPONSE) ) { NPC_UseResponse( traceEnt, self, qfalse ); WP_ForcePowerStart( self, FP_CONTROLMIND, 1 ); } }//NOTE: no effect on TEAM_NEUTRAL? vec3_t eyeDir; AngleVectors( traceEnt->client->renderInfo.eyeAngles, eyeDir, NULL, NULL ); VectorNormalize( eyeDir ); G_PlayEffect( "force/controlmind_touch", traceEnt->client->renderInfo.eyePoint, eyeDir ); //make sure this plays and that you cannot press fire for about 1 second after this //FIXME: BOTH_FORCEMINDTRICK or BOTH_FORCEDISTRACT NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEPUSH, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD ); //FIXME: build-up or delay this until in proper part of anim } else { if ( self->client->ps.forcePowerLevel[FP_CONTROLMIND] = FORCE_LEVEL_1 && tr.fraction * 2048 > 64 ) {//don't create a diversion less than 64 from you of if at power level 1 //use distraction anim instead G_PlayEffect( G_EffectIndex( "force/force_controlmind_fail" ), tr.endpos, tr.plane.normal ); //FIXME: these events don't seem to always be picked up...? AddSoundEvent( self, tr.endpos, 512, AEL_SUSPICIOUS, qtrue, qtrue ); AddSightEvent( self, tr.endpos, 512, AEL_SUSPICIOUS, 50 ); WP_ForcePowerStart( self, FP_CONTROLMIND, 0 ); } NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEPUSH, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD ); } self->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in self->client->ps.saberBlocked = BLOCKED_NONE; self->client->ps.weaponTime = 1000; if ( self->client->ps.forcePowersActive&(1<<FP_SPEED) ) { self->client->ps.weaponTime = floor( self->client->ps.weaponTime * g_timescale->value ); } } sorry for disturb, guys. i make my new force power for single player. it's a force controlmind. well, this power it's like mindtrick level 4: it control an NPC (only certain classes, not bosses) and the NPC can be moved by the player. also, after a loong evening of test and debugging, i get a goal: npcs controlled are targetted as playerteam.. and so, enemy can attack and kill controlled npc. also, controlled npc can attack and kill enemies. if a controlled npc die, player take again the control of the jedi. what i need is a little suggest or help for end this power.. the "press jump to space" function is displayed on the screen, but "jump" button not work. (simply controlled character jump, but camera not turn on player jedi ) also, after is the power time is expired (possession during 20 sec for level 1, 40 sec for level 2 and 60 sec for level 3. ) , Npc never stop to be controlled by player. only if Nppc controlled die, the controls turn on the main character. so, i am asking about two thing: - what's wrong in this code about the timing expiring of the power? it nullify visual efx of possession into the front of NPC, but not turn camera to the jedi and not get again available the main character as player. - how can i add a bind for a button key in the code of this power, so if i press a key, the power is stopped and disconnetted and player can take again the control of itself? power is builded around the original mindtrick code. thanks for any answer.