MinoMino / minqlx

Extends Quake Live's dedicated server with extra functionality and scripting.
GNU General Public License v3.0
112 stars 42 forks source link

Game logic functions, pt. I #18

Closed MinoMino closed 9 years ago

MinoMino commented 9 years ago

Start to add some additional game logic functions. Stuff like:

These should all be pretty easy to implement, especially now that I have updated structs. I'll edit this post and add more if something else comes to mind.

MinoMino commented 9 years ago

Added position and velocity stuff: e863543a175ae9784b0a4e1adfe1f868cedc20f9

Quick demos:

MinoMino commented 9 years ago

Added set health, armor, and noclip: fd500022a0be545fac59203270b92223a1ff4aa4

Demo:

MinoMino commented 9 years ago

5deae18d1041c48dc87df4a10fc73e701f9e6182 pretty much wraps up this issue. I might sneak in powerups before v0.2.0, but everything in the opening post has been implemented and the methods to use these in Player are quite neat, if I may say so myself.

# Set 1000 UPS in the Z direction.
player.velocity(z=1000)
# Maybe set X too.
player.velocity(x=123, z=1000)
# Move player to current Z + 500
player.position(z=player.state.position.z + 500)
# Give player BFG and LG with ammo.
player.weapons(bfg=True, lg=True)
player.ammo(bfg=100, lg=150)
# Give player RL, but remove all other weapons.
player.weapons(reset=True, rl=True)

# Set player's health, armor, and give him/her noclip.
player.health = 500
player.armor = 250
player.noclip = True