Lua Help

Status
Not open for further replies.
Well, back to the drawing board again. After a recent testing session, I discovered that the hanger doesn't let people hang on it. Instead of being in the code, I'm thinking that this is a problem with the Brak Eggman Missile itself. Does it need to be marked as a projectile to be hangable, or the state S_HANGON_2 to S_BLACKEGG_MISSILE?
 
Last edited:
Giving the object an MF_MISSILE flag fixes the problem of it being hangable, but if you try to hang on it, it glitches with the console printing this:
Code:
WARNING: pickup+.wad|LUA_BODY:20: attempt to index field 'target' (a nil value)
Lua_Body:20 is this:
Code:
if not (actor.target.player.pflags & PF_ROPEHANG or actor.target.player.pflags & PF_ITEMHANG or actor.target.player.pflags & PF_CARRIED or actor.target.player.pflags & PF_GLIDING)
 
This is now "Prisima's Lua Help" thread, because I don't want to flood the "Editing Help" subforum with small things.

Anyway, either this is a problem with SRB2 or a lack ofmy knowledge about Lua: I tried setting a player mobj's "x" and "y" coordinates manually, but was thrown an error by the console telling me to use P_TeleportMove, P_Move, or P_TryMove; yet, when I try those, it locks the player's angle and I cannot change it by the left/right keys, nor by setting it manually. Could someone clear this up for me?
 
Yes, I am calling it every tic. The player still travels/teleport to wherever I want him to, but cannot change angle while teleporting.

That might be the problem, then. P_TeleportMove is intended for one-time use, like when a player enters a teleporter sector, instantaneously appears somewhere else, and can move freely after that. What are you trying to use it for, anyway? Whatever it is might be more easily achieved by modifying momx/momy/momz rather than position directly.
 
The function issue was a red herring: the real culprit was code in the source code that did stuff with players being other players' tracers. I've got this problem fixed, but thanks for the help! (If anyone else has this problem, don't set a player to another player's tracer if the pther player's frame is S_PLAY_CARRY.)
 
Status
Not open for further replies.

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

Back
Top