Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Pre-defined force powers?

Page: 1 of 1
 count_coder
10-07-2004, 6:25 PM
#1
Hello, first I just wanted to thank everyone who still hangs out around here to answer all my silly and sometimes retarded questions.. Everyone of you are a great help.. Thank you..

Anyway, on to my question..

I've made a simple class system.. Basically I have Dark Jedi and Light Jedi.. I want them to spawn with set force powers.. I'm not sure how to do this. I know how to spawn them with unique weapons but I can't figure out how to do this..

Also, on a some what related note.. is it possible to spawn with the jet pack or cloaking device? I know when you type /giveall or whatever you get them.. anyway..

Thank you very much:bdroid2:
 razorace
10-08-2004, 12:12 AM
#2
Can't really help you with the forcepowers but I do know that you could make players spawn with the jet pack or cloak by editting the clientspawn function in g_client (I think).
 count_coder
10-08-2004, 12:59 PM
#3
do you know where to put it? i thought it would be where i have my custom class

switch (client->pers.playerclass)
{
case PCLASS_SCOUT:

client->ps.stats[STAT_WEAPONS] |= (1 << WP_BLASTER);
client->ps.ammo[AMMO_BLASTER] = 100;
client->ps.cloakFuel = 100;
client->ps.stats[STAT_HOLDABLE_ITEMS] |= ( 1 << HI_CLOAK );
client->ps.stats[STAT_WEAPONS] |= (1 << WP_REPEATER);
client->ps.ammo[AMMO_METAL_BOLTS] = 100;

break;
the weapons work but the cloak does not.. :/

any ideas? thanks
 razorace
10-08-2004, 2:40 PM
#4
hmmm, interesting. Try checking how the cloak power-up item acts when it's get picked up.
 count_coder
10-08-2004, 5:40 PM
#5
What do you mean how it acts? do you mean /*QUAKED item_seeker (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
30 seconds of seeker drone
*/
{
"item_cloak",
"sound/weapons/w_pkup.wav",
{ "models/items/psgun.glm", //FIXME: no model
0, 0, 0} ,
/* view */ NULL,
/* icon */ "gfx/hud/i_icon_cloak",
/* pickup */// "Seeker Drone",
120,
IT_HOLDABLE,
HI_CLOAK,
/* precache */ "",
/* sounds */ "",
"@MENUS_CLOAK_DESC" // description
},


under bg_misc? anyway

Also I tried just starting with the seeker and a medpac (bactca canister?) and i still dont spawn with them.. In fact I can't seem to find bacta or a seeker drone as pick ups in any level in ja, do you know a level that has one of these?

client->ps.stats[STAT_HOLDABLE_ITEMS] |= ( 1 << HI_MEDPAC );
client->ps.stats[STAT_HOLDABLE_ITEMS] |= ( 1 << HI_SEEKER );
 razorace
10-08-2004, 9:16 PM
#6
hmmm, interesting. My guess is that you placed the code in a spot where it only works for some gametypes.
 count_coder
10-08-2004, 10:22 PM
#7
yeah.. i have it for my custom gametype (which is just ffa with a fancy new name) and for duel.. those two gametypes are the only ones that my classes work for.
 razorace
10-09-2004, 11:55 AM
#8
Are you sure that the clientspawn is trying to set it for that gametype then?
 count_coder
10-09-2004, 5:32 PM
#9
BOTF is my gametype but I also have the class thing workable for duel and ffa

if (g_gametype.integer == GT_BOTF || GT_FFA || GT_DUEL) {



client->ps.stats[STAT_WEAPONS] &= ~(1 << WP_BRYAR_PISTOL);
client->ps.stats[STAT_WEAPONS] &= ~(1 << WP_SABER);
client->ps.stats[STAT_WEAPONS] |= (1 << WP_MELEE);


if (client->ps.stats[STAT_WEAPONS] & (1 << WP_SABER))
{
client->ps.weapon = WP_SABER;
}
else if (client->ps.stats[STAT_WEAPONS] & (1 << WP_BRYAR_PISTOL))
{
client->ps.weapon = WP_BRYAR_PISTOL;
}
else
{
client->ps.weapon = WP_MELEE;
}



switch (client->pers.playerclass)
{
case PCLASS_SCOUT:

client->ps.stats[STAT_WEAPONS] |= (1 << WP_BLASTER);
client->ps.ammo[AMMO_BLASTER] = 100;
client->ps.cloakFuel = 100;
client->ps.stats[STAT_HOLDABLE_ITEMS] |= ( 1 << HI_CLOAK );
client->ps.stats[STAT_HOLDABLE_ITEMS] |= ( 1 << HI_MEDPAC );
client->ps.stats[STAT_HOLDABLE_ITEMS] |= ( 1 << HI_SEEKER );
break;



thats my code.. its right after the siege stuff..
about lines 3333


I'm not sure if this is what you asked.. For some reason I'm not getting it 100% I guess i'm slow today
 razorace
10-09-2004, 5:56 PM
#10
Well, first off, your code is kind of sloppy. The first two lines remove the pistol and saber and then you do some checks as if you still might have them.

Secondly, from experience I don't think the g_gametype.integer == GT_BOTF || GT_FFA || GT_DUEL will nessicarily work. I've had situations where I had to do it like....

g_gametype.integer == GT_BOTF || g_gametype.integer == GT_FFA || g_gametype.integer == GT_DUEL

Anyway, I don't know why your class code isn't actually working. Have you tried using breakpoints to determine if the data path is going to there?
 count_coder
10-09-2004, 6:22 PM
#11
I know the saber stuff is sloppy.. I couldn't figure out how to disable sabers for the non jedi classes..but I have since figured it out and I just haven't gone around and deleted that old code.. Anyway... Thanks for your help.. I have another question.. If you don't mind..

Since u don't know how to make pre-defined force powers.. How hard would it be to swap out the force powers? Like make force saber throw a dark side power.. I would have to edit the UI source, along with alot of other stuff right?
 razorace
10-09-2004, 6:37 PM
#12
Uh, actually, try checking out the clientspawn for how it sets the force powers for the siege classes. That should help you out.
Page: 1 of 1