Some source code help

Status
Not open for further replies.

Conic

Member
I need to access the local player from a console
command to be able to execute this code:
Code:
player->powers[pw_whatever] = 1;

Basically, I'm changing player powers in a console command.

Thanks in advance!
 
I think that he's asking how to code the source so you can edit player data (speed, power, etc) from the console. (I'm aware alll that you want to change from the console is power, but giving data access from the console would also give access to all other data.)
I don't think it's possible as that would be editing the S_SKIN ingame.
 
The player powers are variables that control the player.

A few of them are:

pw_super
pw_homingring

I'm trying to make a console command that will edit these variables in the player struct.
 
You can look for other console commands that do similar stuff, look in the code for cv_homing or cv_ringslinger and see how their "on_changes" work.
You don't need to go have the game editing the S_SKIN, because the S_SKIN is just a script that tells the game what powers to give the player, right? So all you need to do is look in the code for whatever thing you type in the S_SKIN to get whatever power, the text is linked to whatever boolean or value is used to turn that power on, so you can backtrack and look for what the game does if the power value/boolean is true or at a certain value.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top