Jump to content

Home

Duel 'State' changements :)


Code

Recommended Posts

Greetings

 

i am trying to modify 'a duel' in FFA

 

things i am trying to do :

set the 'duelers' hp and armor on duel start and duel end

disable force usage in duel (disable kick and jump)

 

im new to this , i mean i never coded other mods

ive been trought the "resourse" sticky thread (and links)

and cant seem to find any help, great thread btw

 

what functions should i check for this ? (to make changes)

 

does it have something to do with 'ps.duelInProgress'

maybe not ...ive been looking for a "DUELSTART" function

cant find it :(

 

thanks alot o greats one :)

 

edit :

ok i think im getting closer code\game\g_active.c near line 1100

getting warner ? :confused:

Link to comment
Share on other sites

ok i found the interesting part (the end part)

 

 

//Winner gets full health.. providing he's still alive

if (ent->health > 0 && ent->client->ps.stats[sTAT_HEALTH] > 0)

{

if (ent->health < ent->client->ps.stats[sTAT_MAX_HEALTH])

{

ent->client->ps.stats[sTAT_HEALTH] = ent->health = ent->client->ps.stats[sTAT_MAX_HEALTH];

}

 

....

 

}

 

can someone point me out about the armor alocating :)

(winner get 100 shields)

 

ent->client->ps.stats[sTAT_ARMOR] = ent->health = ent->client->ps.stats[sTAT_MAX_HEALTH];

 

something like that ?? (dosent really work)

Link to comment
Share on other sites

ive disabled the use of push while locking in a duel (in ffa)

 

qboolean WP_ForcePowerAvailable( gentity_t *self, forcePowers_t forcePower )

{

int drain = forcePowerNeeded[self->client->ps.fd.forcePowerLevel[forcePower]][forcePower];

 

if (self->client->ps.fd.forcePowersActive & (1 << forcePower))

{ //we're probably going to deactivate it..

return qtrue;

}

 

if ( forcePower == FP_LEVITATION )

{

return qtrue;

}

if ( !drain )

{

return qtrue;

}

if ( self->client->ps.fd.forcePower < drain )

{

return qfalse;

}

// disabling EVERY force power in a duel

// well i tought i did ....just push ..... y ? HELP ME PLZ :(

if (self->client->ps.duelInProgress)

{

return qfalse;

}

 

return qtrue;

}

 

i dont get it :(

jump is still available (i mean 'force' jump)

and kick also :p

 

plz help

Link to comment
Share on other sites

Don't look at WP_ForcePowerAvailable... go to bg_misc.c and look at qboolean BG_CanUseFPNow() - there's something to do with dueling there.

 

If I'm not mistaken in the section: (line 1313)

 

if (ps->saberLockFrame || ps->saberLockTime > time)
{
	if (power != FP_PUSH)
	{
		return qfalse;
	}
}

 

remove the "!" in "if (power != FP_PUSH) return qfalse;". That should make it work, although be warned that some of the changes that I've made to my source have caused very weird stuff to happen...

Link to comment
Share on other sites

thanks alot for the reply

 

for the book i think if i do so

i would have disabled push in any saber locking posibility

(ie : ffa , duel , etc)

if (ps->saberLockFrame || ps->saberLockTime > time)

{

if (power != FP_PUSH)

{

return qfalse;

}

if (ps->duelInProgress && power == FP_PUSH)

{

return qfalse;

}

}

 

nyway

i did edit the code in that section

my goal is to make 'nf duel' in a FF FFA :)

 

so just a liitle above your pointer :) (thanks again)

if (ps->duelInProgress)

{

//if (power != FP_SABERATTACK && power != FP_SABERDEFEND && /*power != FP_SABERTHROW &&*/power != FP_LEVITATION)

//{

// if (!ps->saberLockFrame || power != FP_PUSH)

// {

// return qfalse;

// }

//}

// no matter what no force in duel

return qfalse;

}

 

simple i though :rolleyes:

it did the job ...but lol

now the duelers are jumping like a milimiter high lol (lv0 jump i guess)

 

so i was wondering if u knew how set the force level of a client ?

the thing is i think ill have to stored it (to set it back at what is was before)

 

seeing a better aproach ?

 

thanks

Link to comment
Share on other sites

my goal is to make 'nf duel' in a FF FFA

 

so i was wondering if u knew how set the force level of a client ?

 

like i said I WANT EVERY FORCE DISABLED

so its working now

 

except the faq that force jump is at level 0 while they duel

(hard to jump stairs)

 

so how can i limit the use for jump while a duel to lv1 ?

 

(client might b level2 , level3)

Link to comment
Share on other sites

The way you stated that, Commodus, it would probably actually change the player's force jump skill level. You don't want that. A better solution would be to limit Force Jump to level 1 inside the actual Force Jump function (I don't know what it's called at the moment). Probably something like....

 

if (self->client->ps.fd.forcePowerLevel[FP_LEVITATION] >= FORCE_LEVEL_1)
//Level 1 jump

if (self->client->ps.fd.forcePowerLevel[FP_LEVITATION] >= FORCE_LEVEL_2)
//Level 2 jump

if (self->client->ps.fd.forcePowerLevel[FP_LEVITATION] >= FORCE_LEVEL_3)
//Level 3 jump

To limit duelers to level 1 you'd change that to something like

if (self->client->ps.fd.forcePowerLevel[FP_LEVITATION] >= FORCE_LEVEL_1)
//Level 1 jump

if (self->client->ps.fd.forcePowerLevel[FP_LEVITATION] >= FORCE_LEVEL_2  && !ps->duelInProgress)
//Level 2 jump

if (self->client->ps.fd.forcePowerLevel[FP_LEVITATION] >= FORCE_LEVEL_3 && !ps->duelInProgress)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...