lfnetwork.com mark read register faq members calendar

Thread: force sight and entities
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 05-26-2007, 09:03 PM   #1
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
force sight and entities

Hey guys, just wanted to share tips with you that would help with coop and other gametypes. First one I wanted to share was officers with keys. In sp when force sight is activated they are highlighted with blue instead of red or green like other npcs. To get this working I added at the end of SP_NPC_spawner in NPC_spawn.c this:

if(self->message)
{
//force see - hack setting officers with key with hack time to a 100 so can see them in client side with a blue hue
self->s.generic1 = 100;
}


Then in cg_players.c near the end of CG_Player inside of

if ((cg.snap->ps.fd.forcePowersActive & (1 << FP_SEE)) && cg.snap->ps.clientNum != cent->currentState.number && cg_auraShell.integer)
{

I did this to implement the request of the server side hack:


if( cent->currentState.NPC_class == CLASS_IMPERIAL && cent->currentState.generic1 == 100 )
{
legs.shaderRGBA[0] = 0;
legs.shaderRGBA[1] = 0;
legs.shaderRGBA[2] = 255;
}

Right after it does the colorings after the other stuff. Ok, now the next part is only useful for people using the ojp basic code as their base, near the end of CG_General in cg_ents.c before:

if (cg_debugBB.integer)
{
CG_CreateBBRefEnts(s1, cent->lerpOrigin);
}

I did this:

if( ( cent->currentState.eFlags & EF_FORCE_VISIBLE ) &&
( cg.snap->ps.fd.forcePowersActive & (1 << FP_SEE) ) )
{
ent.shaderRGBA[0] = 0;
ent.shaderRGBA[1] = 0;
ent.shaderRGBA[2] = 255;
ent.renderfx |= RF_MINLIGHT | RF_NODEPTH;

//only level 2+ can see players through walls
if (cg.snap->ps.fd.forcePowerLevel[FP_SEE] < FORCE_LEVEL_2)
ent.renderfx &= ~RF_NODEPTH;

ent.renderfx &= ~RF_RGB_TINT;
ent.renderfx &= ~RF_FORCE_ENT_ALPHA;
ent.customShader = cgs.media.sightShell;

trap_R_AddRefEntityToScene( &ent );
}

That makes the force_visible stuff in the server available to see with force sight . Hope that is useful.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 05-26-2007, 10:37 PM   #2
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
cool. Tinny how about you add this to OJP code?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 05-26-2007, 11:11 PM   #3
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Honestly dood, i tried getting them to highlight but had no luck :/

You should also note, the SP maps have areaportals and seeing is not immune to them like in SP. Would be bad to mark ents with SVF_BROADCAST too, thats just way too much extra bandwidth and will be extra lag.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 05-27-2007, 12:30 AM   #4
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Thanks for the heads up Ensi and will be glad to Razor . I forgot that entitystates don't carry a lot of the info for npcs and players across the network and it is playerstate that does it, so forget the server side hack for the imperial officers I posted above, it should be in NPC_Spawn_Do inside of:

if ( ent->message )
{//has a key

and this line should be used instead:

newent->client->ps.generic1 = 100;

The client side remains the same as above oddly *_~


Redeemed!

An old school mod for jedi academy.

Last edited by Tinny; 05-27-2007 at 01:26 AM.
Tinny is offline   you may: quote & reply,
Old 05-27-2007, 01:51 PM   #5
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
was that fixed in he OJP code you commited?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 05-27-2007, 06:15 PM   #6
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Yep


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > force sight and entities

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:36 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.