Rumia's Lua Abominations

Status
Not open for further replies.
I figured as much, but I don't know how exactly to fix it or what to suplement in to account for friction.
 
I figured as much, but I don't know how exactly to fix it or what to suplement in to account for friction.
If it's a "mach speed" section, you might be able to just force the speed of the player object (so decreasing it if it gets too high), rather than just keeping it from getting low or something.

If it's just a normal gameplay section, then it's just a universal slope-related issue with low friction values, which should be taken into account by the character's creator (but is hard to do much about while still keeping legitimate high speed possible, as there's not any slope-related Lua stuff available yet, so one can't check how steep a slope is very easily).

In the latter case, it's basically just not really your fault, though you could avoid it by making the slope physics-less by changing a linedef flag for the slope, but then normal-friction characters won't get a little more or less speed from running down or up the slope, respectively.
 
Is there any way for the player to destroy enemies by touching them that doesn't involve using invincibility?
 
Is there any way for the player to destroy enemies by touching them that doesn't involve using invincibility?
You can script a way yourself using the TouchSpecial Lua hook.
 
Last edited:
How do I allow the player to jump while the race countdown is going?

EDIT:Also, how can I check what the friction is of the sector a player is in?
 
Last edited:
You can't.

In p_user.c:8801:
Code:
if ((gametype == GT_RACE || gametype == GT_COMPETITION) && leveltime < 4*TICRATE)
{
        cmd->buttons &= BT_USE; // Remove all buttons except BT_USE
        cmd->forwardmove = 0;
        cmd->sidemove = 0;
}

Friction is implemented with thinkers that set the friction of all mobjs in their sector.
Therefore, the sector friction would be the mobj's minus the default (see https://wiki.srb2.org/wiki/Lua/Userdata_structures#mobj_t)
 
Last edited:
How would I go about changing a console variable (for example cam_height or cam_distance) using a Lua variable (like player.mo.health or something)?
 
If the camera only changes once in a while, you can use COM_BufInsertText(player_t player, string text) to execute a console command in that player's console. If you're going to be dynamically changing the camera every tic though, you're better off modifying the camera itself using a HUD hook.
 
Status
Not open for further replies.

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

Back
Top