• Work continues

General Info
Main Page
Latest News
Schedule
What is it?
About Matt
About This Site

Duke Enhancements
Latest Features
Older Features
Cheat Codes

Duke Insider
Language Basics
Compile Time
Room over Room
Player Structures
UserDef Explanations

More Information
Features Database
E Duke Forum

WW2GI Enhancements
Variables
Weapon Changes
Weapon Settings
System Variables
Events
All


Player Structures

This is the player structure that's available through the setplayer and getplayer commands:

shield_amount - get/set the armor amount.

steroids_amount - get/set the steroids amount.

jetpack_amount - get/set the jetpack amount.

scuba_amount - get/set the SCUBA gear amount.

heat_amount - get/set the nightvision amount.

holoduke_amount - get/set the holoduke amount.

look_ang - the angle that player is looking, not facing. i.e. when you use the lookleft/right commands.

ang - the angle that player is facing.

last_pissed_time - counter for the time since player last used a toilet. Used to determine whether you get health or not.

weapon_sway - value set refers to a position in the weapon's sway pattern.

bobcounter - stores the value of weapon_sway when the sway ends and returns its value when the swaying starts again.

curr_weapon - the value of the current weapon being used.

last_weapon - the value of last weapon used. Used if you switch to a weapon with no ammo, it will switch back to this weapon. Is set to -1 if there was no last weapon or if weapon change was succesful.

newowner - the actor ID of the view cam being used. If none is being used the value is -1. Setting it will force the view to the view cam with the appropriate actor ID. If forced an attempt to move or press esc will force the camview to the player's view. Thus if forced I would advise detecting an attempt to break the forced view and allow a return to normal viewing.

quick_kick - appears to store the information on whether a quick kick is being executed or not.

holoduke_on - returns a value of 2 if the holoduke is on, else it is -1.

actors_killed - number of monsters player has killed.

max_actors_killed - maximum number of monsters to kill.

secret_rooms - number of secrets player has found. Now we can set secrets to things other than rooms by adding one to this value.

max_secret_rooms - maximum number of secrets to find.

holster_weapon - 1 if holstered. Setting it to one has the same effect as pressing the holster key except the fact that the animation is not executed and the gun still appears to be draw.

scuba_on - 1 if the scuba gear is being used. Not a good idea to set probably.

jetpack_on - works a bit differently, value changes when it is activated and then returns to zero. I think it goes 0 2 8 0. This one will be an ass I can see.

heat_on - 1 if it's on.

hbomb_on - 1 if a hbomb is thrown and detonator is ready. If the weapon is set to time detonate (no remote) this value remains 1.

footprintpal - pallette used for current footprints.

transporter_hold - similiar to the lockplayer command, counter for teleporter hold.

inven_icon - returns the value of the current icon for the inventory. I'm assuming it's in tile order. 0 for none and then 1 upwards.

cheat_phase - 0 is none is happening, -1 when you press M, 1 when you press S and the rest of the cheat code and then back to 0. MS? Wonder what that stands for...

somethingonplayer - 0 when a slimer is on you, -1 when not.

on_ground - 1 if player is ground, 0 if player is not.

footprintshade - set the shade of your footprints.

on_crane - -1 if player is not on a crane, 1 if player is: setting the value to 1 will lock the player like they are on a crane.

firstaid_amount - inventory amount of med kit.

rapid_fire_hold - 0 unless player is holding fire whilst holding a pipebomb. Nothing seems to happen when you set it.

jumping_toggle - 1 if player is jumping, 0 if player is not.

footprintcount - counter for the number of foot prints player makes make.

jumping_counter - counts the lenght of time the player has been jumping

boot_amount - boot item amount.

cursectnum - the sector the player is in.

crack_time - counter for knuckle cracking.

spritebridge - gives 1 if player is on a floor flattend sprite.

ang - the player's angle.

over_shoulder_on - view mode, 1 means it's on, 0 means it's not.

zoom - It is initialized to 768
It is the zoom of the map view.
Minimum value is 48. Maximum is 2048

exitx
exity
-
These are set to the walls x and y of the sector that contains a lotag of -1 (65535)
They are not used by the code for anything.
It appears to be remnants of an auto-exit or something

loogcnt
numloogs
loogiex[64]
loogiey[64]
-
(Note: loogiex[64] and loogiey[64] are not currently accesible...)
If the player is hit by SPIT, then. well. something.
numloogs is set to 3 + random(0->8)
loogcnt is set to 24*4
For each numloogs, loogix[] and loogiey[] are set to randomized x and y ON THE SCREEN
These loogies are then displayed on the screen using tile LOOGIE
I don't see where these are ever removed from the list.

posx
posy
posz
oposx
oposy
oposz
-
'o' version are 'old' versions saved each frame as temp. these are the player's location. This is used in many places instead of the player's sprite position...

truefz
truecz
-
These are the actual Z of the floor and ceiling. This is also modified by a SE with a lotag of 17 (somebody please fill in what that is...)

i - This is the player's sprite ID.

horiz
ohoriz
-
Horiz is the 'look up/down' value: lookup adds 12, lookdown subtracts 12.
To simulate what LOOKUP does internally, set return_to_center to 9, add 12 to horiz. If player is running, add another 12.

ohorizoff
horizoff
-
Horiz is initialised to 140. 'O' version hold the Old versions temporarily. Horizoff appears to be the auto 'look up/down' based on sector slope. horiz and horizoff are used together to calculate the view.

invdisptime - This is the inventory display time (of course! :)
It is set to 26*2 when the user hits the 'inventory left' or 'inventory right' buttons. If it is >0 then it it decremented each frame.

bobposx
bobposy
-
These are modified when the player is in a sector with a SE with a lotag of 0 and a sector with a floorstat with bit 64(10) set.
This seems to give the player's SPRITE a xvelocity related to the difference (sqrt) between posx, posy and bobposx, bobposy
They are reset to their non-bob versions each frame.

player_par - This is a simple counter that is used to display the player's time in the level.
This will give a count of how long the player has been in the level... Maybe useful for triggering things only after a certain amount of time...... It's only currently used to display the 'par' times at the end of the level.

visibility - This is used to compare the number set as the first parameter in the gamestartup command. It controls whether the player is visible or not. If the player is near an explosion, it is set to -127 (negative max) Weapons without the NOVISIBLE flag set this to zero. It doesn't appear that anything is actually using this variable... ??

pals_time
pals[3]
-
pals_time is defaulted to zero when the player starts, or when a level is loaded. It is set to the first parameter for the command pal from pals[0-2] are set to the next three parameters. It is a count-down timer. It is also set internally when the player takes damage.

randomflamex - This is not used for anything in the game. It is available for use.

weapon_ang - weapon_ang is initilized to zero. It used as a negative offset from the weapon position display. It is not set by any other code. I appears to be a false attempt at weapon-bob that never got used or removed.

refresh_inventory - refresh_inventory is initialized to zero when a map is loaded. If set to non-zero, then a 'inventoryleft' is performed once and refresh_inventory is reset to zero.

wackedbyactor - This is a spriteID. This stores which actor killed the player. It is initialized to -1 when a map is loaded and on resetplayer.

frag
fragps
fraggedself
-
fragps is the player ID of the player that killed the current player.
fragps is initialized to 'self'.
frag is the number of frags the player has.
fraggedself is the number of times the player has killed herself.

show_empty_weapon
last_full_weapon
-
show_empty_weapon is a count-down timer.
It is initialized to zero.
It is set to 32 when a new weapon is picked up.
When show_empty_weapon reaches zero from non-zero, the subweapon flag is set if the last_full_weapon was GROW_WEAPON.
More will have to be done here to allow any weapon type to have sub-weapons...
last_full_weapon is initialized to zero when a map is loaded.
It is set to the weapon ID of the previous weapon when a new weapon is picked up.

on_warping_sector - This is used as a boolean. Valid values are zero and one. It is initialized to zero when a map is loaded. This is set by a transporter sprite type (statnum == 10) to one. It is reset to zero when processed (kinda).

ammo_amount[MAX_WEAPONS] - Note: not accessible yet because it's an array. These are the ammo_amounts for the specified weapons.

gotweapon[MAX_WEAPONS] - Note: not accessible yet because it's an array. These are flags that specify if the player already has the weapon

oang - used to temporalily store ang while calculations are being performed.

last_extra - extra is the player health, last_extra contains the previous value of extra.

subweapon - This controls the secondary weapon choice. Currently only GROW_WEAPON is supported. I will have to expand this to allow other secondary weapon choices.

tipincs - A count-down timer, set to 26 by the 'tip' CON command. If non-zero, it is used to sequence the tipping animation.

wantweaponfire - This is set to the weapon ID that is being SELECTED (not fired). It it reset after the weapon is checked.

hurt_delay - This is a count-down timer. It is used to provide a delay between damage for items that auto-hurt.
-Set and check for delay:
CACTUS: set to 16. Delay until 8
-Set, but don't delay:
FORCEFIELD: 16
BIGFORCE: 26

hbomb_hold_delay -This is used for display purposes. It is > 0 when the player is throwing a pipe bomb. It sequences through the animation and then is reset to zero.

scuba_amount
scuba_on
airleft
-
AirLeft: This is the amount of 'breath' that the player has left. It is a count-down timer ONLY when
1) underwater and scuba off (sector.lotag == 2 and player.scuba_on == 0)
2) player runs out of scuba amount
If it reaches zero, then Player takes damage (extra_extra8 is incremented by 32) It is initialized to 15*26 when a map is loaded. (approximately 20 seconds?). scuba_on is set to one when the player is underwater and there is scuba air left (scuba_amount) It is set to zero when the scuba is on and the scuba_amount is decremented to zero. It is also reset to zero when not underwater (sector.lotag == 20)

knee_incs - This is used to control sequencing of the knee animation (mighty foot) (max value for animations is 11). This is a non-zero count-up timer (if set to non-zero, it counts up). It is reset to zero after is reachces 15.

access_wallnum
access_spritenum
access_incs
-
Like tip_incs, this is used to sequence the key-card access display. access_incs is a non-zero count-up timer. Max value is 20.
When 'using' a wall or sprite that needs access, it checks to see if the player has the correct access card and then starts the access animation by setting access_incs to one. It also sets the access_walnum or access_spritenum to itself.
For sprites, the access card animation takes on the palette of the 'target' access sprite.
got_access bits are UN-set for the access after it is granted:
pal: 0 bit 0
Pal: 21 Bit 2
Pal: 23 Bit 3

fta
ftq
-
fta is a count-down timer for the time to display a quote. ftq is the quote to display.

kickback_pic
got_access
-
These haven't been covered yet,,,

one_parallax_sectnum - For SE with a lotag of 13, the sector's ceilingpicnum and ceilingshade is set to this sector's ceilingpic and ceilingshade. This only comes from playerID of zero. This is set for player 0 only when a level is loaded to the first sector found with ceilingstat with bit 0 set.

random_club_frame - This is initialized to zero. The comment in the code says 'Glowing'.... For WW2GI, this is incremented by 64 each frame if the current has the WEAPON_FLAG_GLOWS flag. Also, if it's not zero, you can't fire the shotgun (I don't know why...) When the shrinker or grower are dispalyed on the screen, tile SHRINKER +2 is drawn using this as a modifier, then the normal weapon is drawn.

fist_incs - This is a non-zero count-up timer. It is used to sequence display of the FIST tile on the screen. It holds at 32. Set to 1 to start animation of fist.

one_eighty_count - If one_eighty_count is less than zero, then 128 is added to one_eighty_count and ang. (this lets the player turn a set angle over time...) This is set on key TURNAROUND to -1024. To completely emulate what is being done during EVENT_TURNAROUND, just set one_eighty_count to -1024.

dummyplayersprite - When going underwater, a dummyplayersprite of PLAYERUNDERWATER is spawned. This sprite ID is tracked in dummy player sprite. This sprite is made to follow the player's position. The sprite is killed when the player moves back out of water.

extra_extra8 -This is initialized to zero. The player is given this amount of damage divded by 256 (shift right by 8). If no actual damage is done, then the value is not cleared. The actual damage applied to the player is modified by shield_amount.

actorsqu - This is initialized to -1. It's the actor squished... the actor that you are stepping on when they are shrunk. When knee_incs is > 0 then the player is made to face the squishee. The actor is actually killed when knee_incs reaches >15.
In multiplayer, you auto-squish other players who are shrunk. This is done by setting:
knee_incs = 1;
weapon_pos = -1;
actorsqu = ps[otherp].i;
This is also set by the CON command pstomp.

timebeforeexit
customexitsound
-
This is a non-zero count-down timer. At 26*5, all sounds are stopped and the customexitsound is played if it is > 0. If customexitsound, quote 102 is displayed.
At one, all players are set to end of level mode (.gm) (MODE_EOL) and the next level number is set... Hmm.. Fun stuff could happen here if I had an event...

weaprecs[16]
weapreccnt
-
These have something to do with picking up a (active?) handbomb sprite only once... It's used (only used and set) by the CON command ifgetweaponce (so [16] should actually be [MAXWEAPONS]...)

interface_toggle_flag - This is used to dis-allow commands from being processed when the menus are up. (or something).
Set to zero it allows normal processing.
Set to 1, it disables processing.
It seems to be set when a multiplayer game is starting. More research needed...

rotscrnang - This controls the angle warping of the screen. To emulate LOOKLEFT, subtract 152 from look_ang, and add 24 to rotscrnang.

dead_flag - This is initalized to zero. This is used to control one-time processing when player dies. When health (extra) is <0, then dead_flag is checked and then set.

show_empty_weapon - This is a non-zero count-down timer. It's used to change weapons. when picking up a new weapon.... maybe.

pycount - used to modify pyoff. It is an increasing angle that is used to get sin for use in pyoff (resulting in a bobbing effect). It's incremented by 32 or 52 if the jetpack isn't on, etc...

weapon_pos - used to control display placement and sequencing. When set to -9, it stops counting and checks for reseting last weapon. When set to any other non-zero value, it is decremented until it reaches zero or -9. It's also used when placing the weapon tile(s) on the screen for raising and lowering of the weapon(s).

frag_ps - This is set to the player that fragged this player. It is initialized to 'self'.

gm- GameMode. Valid values are:
MODE_MENU 1 Menu is being dispalyed
MODE_DEMO 2 Demo is being played back
MODE_GAME 4 Game is running
MODE_EOL 8 End of Level has been signaled
MODE_TYPE 16 User is typing chat message
MODE_RESTART 32 Level is restarting
MODE_SENDTOWHOM 64 Choosing who to send message to
MODE_END 128 Game is ending(exit main game loop)

name[32] - This was probably meant to be the player's name, but it's not used.

buttonpalette - This saves the palette of the hit NUKEBUTTON. It's used when fist_incs reaches 42 and the next level is calculated.

lastrandomspot - This is initialized to zero and is not used.

*palette - The pointer to the current palette in use.

toggle_key_flag - This seems to be used for 'hitting' things with the space key. Cameras and queue balls.

knuckle_incs - Initialized to one. This is used for animating the knuckle cracks. If it is 10 and the game has been going for a while (totalclock>1024), then knuckle cracking is started. When it reaches 22, or when a weapon is fired, it resets to zero.

select_dir - This is not used and is not initialized.

walking_snd_toggle - This is initialized to zero. It is a non-zero count-down timer This is used to delay making walking sounds to that they occur every 'other' frame.

palookup - This seems to be used as a pal when the sector doesn't have a pal set... Hmm. This is the player's 'color'/'team'?
When a level is loaded, it is set to the pal of the player sprite for that player if it is non-zero. If sprite's pal is zero, then it increments from 9 to 16 and back again.

hard_landing - This is a non-zero count-down timer. When the player lands on ground with a large velocity, hard_landing is set with the velocity. This causes the display to 'bounce' down as if in a hard landing on the ground.

Copyright © 2000, Matt Saettler. All Rights Reserved