Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 10 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Soldier of Fortune
Category: SoFII Mapping
Mapping, modeling, scripting, skinning and all forms of editing for the game Soldier of Fortune II
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: APOXOL - Help Please!
D3VIANCE~rb
General Member
Since: Dec 23, 2006
Posts: 63
Last: Dec 23, 2006
[view latest posts]
Level 3
Category: SoFII Mapping
Posted: Monday, Mar. 10, 2003 09:31 pm
// playerState_t is the information needed by both the client and server to predict player motion and actions
// nothing outside of pmove should modify these, or some degree of prediction error will occur
// you can't add anything to this without modifying the code in msg.c


The above, found in q_shared.h, is absolutely true, and has stopped me from adding in a new variable for a new "g_blah" cvar I was going to cross-reference in g_active.c, as you have done with g_speed, for example:

// set speed
client->ps.speed = g_speed.value;

I wanted to do this so I could use the format "pm->ps->blah" in bg_pmove.c, as I cannot seem to refer to "g_blah" and get the compiler to recognise it.  I've noticed that none of the bg_* files actually refer to any of the game's cvars, and this is probably why.

Oh, and I can't find msg.c anywhere.  :(

--=--

In short - please tell me how to use a conditional statement ( "if (g_blah.integer) { }" ) in bg_pmove.c, where g_blah is any given cvar, such as g_speed, g_friendlyFire etc.

Many thanks in advance!
Share |
slowJusko~rb
General Member
Since: Dec 23, 2006
Posts: 457
Last: Dec 23, 2006
[view latest posts]
Level 5
Category: SoFII Mapping
Posted: Monday, Mar. 10, 2003 10:12 pm
Setup a regular g_bla cvar with the CVAR_SERVERINFO flag set.
Then detect said cvar client side

ie. bg_allowProne from ManDown :
In g_main.c near the top :
vmCvar_t bg_allowProne;

In g_main.c at the end of gameCvarTable :
{ &bg_allowProne, "g_allowProne", "1", CVAR_SERVERINFO|CVAR_ARCHIVE, 0.0, 0.0, 0, qtrue  },

In bg_public.h somewhere :
extern vmCvar_t bg_allowProne;

In cg_main.c near the top :
vmCvar_t bg_allowProne;

In cg_info.c, CG_DrawInformation() :
bg_allowProne.integer = atoi(Info_ValueForKey(info, "g_allowProne"));
In cg_servercmds.c, CG_ParseServerinfo() :
bg_allowProne.integer = atoi(Info_ValueForKey(info, "g_allowProne"));

In bg_pmove.c, anywhere I need to use it :
if (bg_allowProne.integer  bla bla bla

Hope that helps.
Share |
D3VIANCE~rb
General Member
Since: Dec 23, 2006
Posts: 63
Last: Dec 23, 2006
[view latest posts]
Level 3
Category: SoFII Mapping
Posted: Monday, Mar. 10, 2003 10:16 pm
Haven't tried it yet, but just reading that makes perfect sense.  :;):

Thanks m8, my trusty brain just couldn't work this one out.  :p

You're a star!
Share |
Sevensins~rb
General Member
Since: Dec 23, 2006
Posts: 274
Last: Dec 23, 2006
[view latest posts]
Level 5
Category: SoFII Mapping
Posted: Monday, Mar. 10, 2003 11:38 pm
ugh, I hate all caps in titles  :angry:

anyways

msg.c is part of the engine code...so you can stop looking :;):


you can't add anything to the playerstate*



(*note: well you can sorta, but its not really worth it)
Share |
D3VIANCE~rb
General Member
Since: Dec 23, 2006
Posts: 63
Last: Dec 23, 2006
[view latest posts]
Level 3
Category: SoFII Mapping
Posted: Monday, Mar. 10, 2003 11:41 pm
Thanks m8, the ManDown example worked a treat.  :)

And I only put Apoxol's name in caps...  :s6:
Share |
Apoxol~rb
General Member
Since: Dec 23, 2006
Posts: 2139
Last: Dec 23, 2006
[view latest posts]
Level 8
Category: SoFII Mapping
Posted: Thursday, Mar. 13, 2003 07:45 pm
All depends on how often your blah cvar is going to be changing.  If it changes alot then you definately dont want to do it via a cvar like was described above.

You cannot change playerstate as a mod maker, but, you can hijack stuff.  For example, if there is something Sof2 that you dont need and uses a playerstate variable then just disconnect the old sof2 code and start using the variable.

In the example of speed it is essential that the speed be in the playerstate and not there as a cvar because if it changes the prediction would get all messed up.
Share |
D3VIANCE~rb
General Member
Since: Dec 23, 2006
Posts: 63
Last: Dec 23, 2006
[view latest posts]
Level 3
Category: SoFII Mapping
Posted: Sunday, Mar. 16, 2003 03:16 am
Gotcha.  Thanks Apoxol, good points also.  :)

My mod gets released next week, and I think Raven will be particularly interested in how it's turned out - as it merges your current and your previous Soldier of Fortune projects into one.   :;):

The PhoeniX is rising...
Share |
Torchy2~rb
General Member
Since: Dec 23, 2006
Posts: 272
Last: Dec 23, 2006
[view latest posts]
Level 5
Category: SoFII Mapping
Posted: Sunday, Mar. 16, 2003 01:14 pm
Quote (D3VIANCE @ Mar. 16 2003, 3:16 am)
it merges your current and your previous Soldier of Fortune projects into one.   :;):

soldier of fortune 33 1/3  :D
Share |
D3VIANCE~rb
General Member
Since: Dec 23, 2006
Posts: 63
Last: Dec 23, 2006
[view latest posts]
Level 3
Category: SoFII Mapping
Posted: Sunday, Mar. 16, 2003 08:09 pm
Hehe, quite.   :p
Share |
sneax~rb
General Member
Since: Dec 23, 2006
Posts: 95
Last: Dec 23, 2006
[view latest posts]
Level 3
Category: SoFII Mapping
Posted: Friday, Mar. 21, 2003 08:16 pm
Quote (D3VIANCE @ Mar. 15 2003, 9:16 pm)
Gotcha.  Thanks Apoxol, good points also.  :)

My mod gets released next week, and I think Raven will be particularly interested in how it's turned out - as it merges your current and your previous Soldier of Fortune projects into one.   :;):

The PhoeniX is rising...

Take out da shotty - time to blow your way through suddan and parking, soaking through piles of intestins and dismemberd pieces of bodies - blood hanging all over the walls, then when you get round the corner, you spot that enemy - you jump and the first opponnent shot misses, you come down rolling (right in front of a body, missing its head) you jump up, and while in the air shoot the fooker a bullet right through his head ... you turn around and repeat the whole process, for every enemy - god I loved that game  :s1:

My text might not be very poetic I'm not original english but you get my friggin' point  :D
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Soldier of Fortune : SoFII Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»