Wall Angles?

crazybark

Member
im trying to make the character align with the wall, currently the character shoots a projectile to there left and gets the angle of the wall and compares it to the players to check how to set the players angle. it works sometimes and other times it just flips the player the other way
 
Can you send your Lua code (should you be using it) so I can take a look?
im trying to make the character align with the wall, currently the character shoots a projectile to there left and gets the angle of the wall and compares it to the players to check how to set the players angle. it works sometimes and other times it just flips the player the other way
 
//right freeslot("MT_WALL_NN6", "S_WALL") mobjinfo[MT_WALL_NN6] = { doomednum = -1, spawnstate = S_WALL, deathstate = S_INVISIBLE, xdeathstate = S_INVISIBLE, spawnhealth = 1, damage = 0, speed = 4*FRACUNIT, radius = 8*FRACUNIT, height = 8*FRACUNIT, flags = MF_MISSILE|MF_NOBLOCKMAP } //right + forward freeslot("MT_WALL_NN9", "S_WALL") mobjinfo[MT_WALL_NN9] = { doomednum = -1, spawnstate = S_WALL, deathstate = S_INVISIBLE, xdeathstate = S_INVISIBLE, spawnhealth = 1, damage = 0, speed = 4*FRACUNIT, radius = 8*FRACUNIT, height = 8*FRACUNIT, flags = MF_MISSILE|MF_NOBLOCKMAP } //forward freeslot("MT_WALL_NN8", "S_WALL") mobjinfo[MT_WALL_NN8] = { doomednum = -1, spawnstate = S_WALL, deathstate = S_INVISIBLE, xdeathstate = S_INVISIBLE, spawnhealth = 1, damage = 0, speed = 4*FRACUNIT, radius = 8*FRACUNIT, height = 8*FRACUNIT, flags = MF_MISSILE|MF_NOBLOCKMAP } //left + forward freeslot("MT_WALL_NN7", "S_WALL") mobjinfo[MT_WALL_NN7] = { doomednum = -1, spawnstate = S_WALL, deathstate = S_INVISIBLE, xdeathstate = S_INVISIBLE, spawnhealth = 1, damage = 0, speed = 4*FRACUNIT, radius = 8*FRACUNIT, height = 8*FRACUNIT, flags = MF_MISSILE|MF_NOBLOCKMAP } //left freeslot("MT_WALL_NN4", "S_WALL") mobjinfo[MT_WALL_NN4] = { doomednum = -1, spawnstate = S_WALL, deathstate = S_INVISIBLE, xdeathstate = S_INVISIBLE, spawnhealth = 1, damage = 0, speed = 2*FRACUNIT, radius = 8*FRACUNIT, height = 8*FRACUNIT, flags = MF_MISSILE|MF_NOBLOCKMAP } states[S_WALL] = {SPR_RING, 0, 3, nil, 0, 0, S_NULL} addHook("ThinkFrame", function() for p in players.iterate do if p.wallcheck == nil then p.wallcheck = 0 end if p.checkspeed == nil then p.checkspeed = 5 end if p.prespeed == nil then p.prespeed = 5 end end end) addHook("PreThinkFrame", function(p) for p in players.iterate do if(p.parkour == true) p.checkspeed = 10 if not P_IsObjectOnGround(p.mo) P_SetObjectMomZ(p.mo, 1*FRACUNIT/3,true) end p.cmd.sidemove = 0 //p.cmd.forwardmove = 1 P_InstaThrust(p.mo, p.mo.angle, (p.prespeed)) //P_InstaThrust(p, p.mo.angle+ANGLE_90, (5*FRACUNIT)) if(p.mo.angle > 0) if(p.lineangle > 0) p.mo.angle = p.lineangle else p.mo.angle = p.lineangle - ANGLE_180 end elseif (p.mo.angle < 0) if(p.lineangle > 0) p.mo.angle = p.lineangle + ANGLE_180 else p.mo.angle = p.lineangle end end end end end) addHook("PlayerThink", function(p) if (p.parkour == false) p.checkspeed = 5 p.prespeed = p.speed end if(p.wallcheck > 0) p.parkour = false else p.wallcheck = $ + 1 end p.wallcheck = $ + 1 if(abaloho == nil) local NN4 = P_SpawnMobj(p.mo.x, p.mo.y, p.mo.z + p.mo.height , MT_WALL_NN4) NN4.target = p.mo P_InstaThrust(NN4, p.mo.angle, (p.speed)) P_InstaThrust(NN4, p.mo.angle+ANGLE_90, (p.checkspeed*FRACUNIT)) //local NN7 = P_SpawnMobj(p.mo.x, p.mo.y, p.mo.z + p.mo.height , MT_WALL_NN7) //NN7.target = p.mo //P_InstaThrust(NN7, p.mo.angle, (p.speed)) //P_InstaThrust(NN7, p.mo.angle+ANGLE_45, (p.checkspeed*FRACUNIT)) //local NN8 = P_SpawnMobj(p.mo.x, p.mo.y, p.mo.z + p.mo.height , MT_WALL_NN8) //NN8.target = p.mo //P_InstaThrust(NN8, p.mo.angle, (p.speed)) //P_InstaThrust(NN8, p.mo.angle, (p.checkspeed*FRACUNIT)) //local NN9 = P_SpawnMobj(p.mo.x, p.mo.y, p.mo.z + p.mo.height , MT_WALL_NN9) //NN9.target = p.mo //P_InstaThrust(NN9, p.mo.angle, (p.speed)) //P_InstaThrust(NN9, p.mo.angle-ANGLE_45, (p.checkspeed*FRACUNIT)) //local NN6 = P_SpawnMobj(p.mo.x, p.mo.y, p.mo.z + p.mo.height , MT_WALL_NN6) //NN6.target = p.mo //P_InstaThrust(NN6, p.mo.angle, (p.speed)) //P_InstaThrust(NN6, p.mo.angle-ANGLE_90, (p.checkspeed*FRACUNIT)) end if not p.mo return end if p.mo.skin != "czbk_sally" return end if p.playerstate == PST_DEAD return end if not (p.cmd.buttons & BT_USE) and not (p.cmd.buttons & BT_USE) p.recurlheld = false end if !PF_THOKKED p.charflags = SF_HIRES|SF_FASTEDGE|SF_NOJUMPSPIN|SF_MARIODAMAGE|PF_JUMPED end if p.pflags & PF_THOKKED p.charflags = SF_HIRES|SF_FASTEDGE|PF_JUMPED p.mo.state = S_PLAY_ROLL //print("WAZZUP") end if P_IsObjectOnGround(p.mo) p.charability = CA_JUMPBOOST //p.actionspd = ass else p.charability = CA_JUMPTHOK p.pflags = $ | PF_JUMPED //p.actionspd = ass end end) addHook("PlayerCanDamage", function(player) if (player.mo.state == S_PLAY_ROLL) return true end end) addHook("MobjLineCollide", function(mo, line) for p in players.iterate do p.lastline = line p.lineangle = R_PointToAngle2(0,0,line.dx,line.dy) return nil end end, MT_WALL_NN4) addHook("MobjMoveBlocked", function(mobj) for p in players.iterate do print("player" + p.mo.angle) print("wall" + p.lineangle) p.wallcheck = -2 if(p.parkour == false) p.parkour = true end if(p.mo.angle >= 0) if(p.lineangle >= 0) p.mo.angle = p.lineangle else p.mo.angle = p.lineangle + ANGLE_180 end elseif (p.mo.angle <= 0) if(p.lineangle >= 0) p.mo.angle = p.lineangle + ANGLE_180 else p.mo.angle = p.lineangle end else if(p.lineangle > 0) p.mo.angle = p.lineangle + ANGLE_180 else p.mo.angle = p.lineangle end end print("player" + p.mo.angle) end end, MT_WALL_NN4)
Post automatically merged:

Can you send your Lua code (should you be using it) so I can take a look?
any luck?
 
Last edited:

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

Back
Top