KP Lol

  • KP Lol is a Freelancer plugin I have been working on for the past year or so. It adds a console to the game, where you can issue commands. It has a very big list of commands, and I designed it with the intention that it could help other people design DLL plugins or even help modders debug their mods.
    Also, KP Lol will only work in singleplayer. It will refuse to work if you are on a multiplayer server.
    So no worrying about cheating =D



    Some of its features other than console commands:


    - Has a Lua interpreter (you can write Lua scripts)
    Through Lua, you can have custom functions called
    when a key is pressed in-game.
    There is also a lot of functions you can call from Lua
    that do the same thing as some console commands.
    You can also modify FL's constants through Lua.
    - View and edit Freelancer's memory
    - Hook custom code
    - Cloaking when a key is pressed.


    And there are many many more commands, not just these.



    So what i'm asking you guys, is if this sounds like something that would help you design your mods or plugins,
    and whether or not you would be interested and actually use it if I released it.


    Later I will give you guys a command list if you want it but right now I don't have time.

  • Ok, here is a list of console commands:


    mark
    unmark
    malloc <bytes>
    free <pointer>
    view <pointer> <bytes>
    edit <pointer> <bytes>
    hex <string> <- converts a string to hex bytes
    script <string> <- this executes a lua script
    matrix <x> <y> <z> <- converts Euler angles to a rotation matrix
    quaternion <x> <y> <z> <- converts Euler angles to a quaternion, for use in storyline missions.
    setrotation <shipid> <x> <y> <z>
    drainshield <shipid>
    hash <string> <- Calculates a hashcode for a string
    getposition <shipid>
    sethealth <shipid> <value>
    activate <shipid> <equipid> <value>
    enumcargo
    randompos <- this one moves the player to a random position in the system
    setposition <shipid> <x> <y> <z>
    setorientation <shipid> <column> <row> <value>
    killship <shipid>
    offset <module> <pointer> <- this one will take an offset from a file, and get
    the position of it in memory.
    For example, say you found a value in http://www.memes.no/88flak/downloads/beta/1.1_Offsets.txt
    you wanted to change while the game was running. Just type in "offset common.dll 13E6D0"
    and you can then use the "view" and "edit" commands to view and change that value.
    invulnerable <shipid>
    give_stackable <itemname> <amount>
    give_nonstackable <itemname> <amount>
    setcash <amount>
    forceland <basename>
    setrank <rank>
    setrep <faction> <value>
    setmusic <musicid>
    callsign <faction> <form> <num1> <num2>
    getsystem
    getplayer
    gettarget
    settarget
    maxammo
    ship_info <pointer>
    exit
    about
    commands


    List of Lua functions you can use in your scripts:


    conprint("string")
    Prints string to the KP lol console.
    Conprint shouldn't be called during a function registered with regkey().


    player_getpos()
    Returns the player's x, y, and z coords.


    player_setpos(x, y, z)
    Sets the player's coords.


    player_gettarget()
    Returns the player's target ID.


    player_getspaceid()
    Returns the player's ship ID.


    player_setrot(x, y, z)
    Sets the player's x, y, and z rotation values.


    player_getrot()
    Returns the player's x, y, and z rotation values.


    player_setrep("faction", value)
    Sets the player's current reputation with a faction


    player_getrep("faction")
    Returns the player's current reputation with a faction.


    ship_getpos(id)
    Returns a ship's x, y and z coords.


    ship_setpos(id, x, y, z)
    Sets a ship's x, y, and z coords.


    ship_gettarget(id)
    Returns another ship's target ID.


    ship_setrot(id, x, y, z)
    Sets the player's x, y, and z rotation values.


    ship_getrot(id)
    Returns the player's x, y, and z rotation values.


    hash("string")
    Creates a hashcode for string.


    playsound(hash)
    Plays the sound identified by hash.


    playmusic(hash)
    Plays the music identified by hash.


    player_land("base")
    Lands the player on the specified base.


    player_setcash(amount)
    Sets the player's current funds.


    player_getcash()
    Returns the player's current funds.


    player_setrank(amount)
    Sets the player's level.


    player_getrank()
    Returns the player's level.


    player_additem(hash, amount)
    Gives amount of hash to the player.


    player_getship()
    Returns the player's shiparch ID.


    mark(id)
    Marks a ship on the player's HUD.


    unmark(id)
    Unmarks a ship on the player's HUD.


    regkey(key, "function")
    Calls "function" when key is pressed.


    The following constants are accessible from Lua as globals:


    CHATTER_MAX_DIST
    CHATTER_MAX_DIST_ATTEN
    CHATTER_START_ATTEN
    COLLISION_DAMAGE_FACTOR
    COMM_PLAYER_FAR_DIST
    COMM_PLAYER_FAR_DIST_ATTEN
    FIRE_FAILED_DELAY
    JETTISONED_CARGO_VELOCITY
    LOOT_OWNER_SAFE_TIME
    LOOT_UNSEEN_LIFE_TIME
    LOOT_UNSEEN_RADIUS
    MUSIC_CROSS_FADE_DELAY
    MUZZLE_CONE_ANGLE
    PLAYER_ATTACHED_EQUIP_HIT_PTS_SCALE
    PLAYER_COLLISION_GROUP_HIT_PTS_SCALE
    WALLA_MAX_DIST
    WALLA_MAX_DIST_ATTEN
    WALLA_START_ATTEN
    CRUISE_ACCEL_TIME
    CRUISE_ATTEN_MOD_RANGE
    CRUISE_ACCEL_TIME
    CRUISE_DRAG
    CRUISE_STEADY_TIME
    CRUISING_SPEED
    THROTTLE_ATTEN_MOD_RANGE
    THROTTLE_STEADY_TIME


    I plan on expanding on commands and lua constants.


    Also, if anyone would like to give suggestions for commands or Lua functions
    go ahead and I will try to add them in.



    EDIT: To PolarBear, the name "KP Lol" Is short for Kill Player and LOL.
    When I first found flcoresdk and started messing with it, I just made
    a DLL that, when you injected it into Freelancer using a program like
    Cheat Engine, it killed you.

  • EDIT: To PolarBear, the name "KP Lol" Is short for Kill Player and LOL.
    When I first found flcoresdk and started messing with it, I just made
    a DLL that, when you injected it into Freelancer using a program like
    Cheat Engine, it killed you.

    Good reason, yet it still sounds like a dumb name. (no offence)
    Make it sound more professional, pitch up some name that will blast newbies off their seats.

  • Hehe, thanks, but I think I will just stick with the current name. It took me long enough to come up with it when I started, who knows how long it will take me if I concentrate on finding a new name again. I would much rather spend time working on the actual code.


    Anyway, I would like to see more people interested before I consider releasing anything. It's still a bit buggy, and I might as well iron out the kinks in the meantime.

  • Here it is for you all to test out.


    Extract the whole contents to Freelancer/EXE and then add kplol.dll to [Libraries] in dacom.ini
    If you have any questions or find any bugs, PM me or send me an email at jaclewfarn@yahoo.com,
    and let me know what you guys think.