Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Random Image
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
79 user(s) are online (42 user(s) are browsing Forum)

Members: 1
Guests: 78

HeIIoween, more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +0€

Current balance: 55€
(last updated 04/2021)

Please make a donation if you want to help keeping The-Starport online:

Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 79 users playing Freelancer on 39 servers.
May. 18, 2021

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



KP Lol plugin
Starport Admin
Joined:
2008/2/26 20:36
From Germany
Group:
Webmasters
Registered Users
Posts: 1790
Offline
Recently I stumbled upon a plugin named "KP Lol" by themilkman which was posted on lr.org.
I'm reposting it here with permission:

Quote:
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.


Quote:
Ok, here is a list of console commands:

mark
unmark
malloc
free
view
edit
hex <- converts a string to hex bytes
script <- this executes a lua script
matrix <- converts Euler angles to a rotation matrix
quaternion <- converts Euler angles to a quaternion, for use in storyline missions.
setrotation
drainshield
hash <- Calculates a hashcode for a string
getposition
sethealth
activate
enumcargo
randompos <- this one moves the player to a random position in the system
setposition
setorientation
killship
offset <- 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
give_stackable
give_nonstackable
setcash
forceland
setrank
setrep
setmusic
callsign

getsystem
getplayer
gettarget
settarget
maxammo
ship_info
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.


Quote:
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 [email protected],
and let me know what you guys think.


The really interesting part is the Lua interface which allows for easy scripting. I'd like to write a similar (FLHook) plugin one day that would allow for Lua scripts. I think this could easily be the future for FL speciality modding.

Attach file:


zip kplol_112.zip Size: 154.26 KB; Hits: 608

Posted on: 2011/7/17 16:58
aka chaosgrid
http://www.freelancerserver.de
https://www.moddb.com/mods/fwtow
Top
Re: KP Lol plugin
Starport Admin
Joined:
2008/6/24 16:40
From http://www.freeworlds-tow.net/dev
Group:
Registered Users
Starport Admin
$$$ Supporters $$$
Posts: 1123
Offline
Awesome.

Posted on: 2011/7/17 17:13
Open in new window
Top
Re: KP Lol plugin
Home away from home
Joined:
2010/3/14 18:10
From Germany
Group:
Registered Users
Senior Members
Posts: 1526
Offline
impressive indeed. guess that pal would be quite an addition to our set of specialists.

Posted on: 2011/7/17 18:21
Top
Re: KP Lol plugin
Starport Staff
Joined:
2008/10/7 19:56
From England
Group:
Registered Users
Starport Staff
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 638
Offline
I'd quite like to do something along those lines with FLHook + Python. Possibly client-side as well, but I expect that wouldn't go down as well if it could be used to cheat. (Obviously, I would refuse to not distribute the source with it if I ever got around to coding such a thing.)

Edit: Fenris_Wolf did an embedded Perl plugin for FLHook a while back: http://the-starport.net/freelancer/fo ... ewtopic.php?topic_id=2483

Posted on: 2011/7/17 18:49
Top
Re: KP Lol plugin
Home away from home
Joined:
2008/5/4 21:00
Group:
Registered Users
Senior Members
Posts: 554
Offline
Very nice, and I particularly like the name of it too

Posted on: 2011/7/18 18:35
Top
Re: KP Lol plugin
Just can't stay away
Joined:
2008/5/28 18:04
From Maine, USA
Group:
Registered Users
FLServer Admins
Senior Members
Posts: 457
Offline
Awesome. Will have to give this a go. :D

Posted on: 2011/7/23 17:04
88 Flak for Freelancer
1.27 Betas | Wiki | Forums
Top
Re: KP Lol plugin
Just can't stay away
Joined:
2008/8/18 10:10
Group:
Registered Users
FLServer Admins
Senior Members
Posts: 259
Offline
Looks really good. But it wont work for me

Posted on: 2011/7/24 8:43
Top
Re: KP Lol plugin
Just can't stay away
Joined:
2010/10/21 16:18
Group:
Registered Users
FLServer Admins
Posts: 202
Offline
i would like to use this kplol to give items to player at the end of events directly InGame without using IonCross.

I try clientside -> "no cheating permitted in MP" message

Must i use it in serverside ? How configure it ?

and the randompos can be good to make some mini events like HideSeekDestroy

Posted on: 2011/9/21 10:19
Burn the gum, Not your Soul...
Top
Re: KP Lol plugin
Just can't stay away
Joined:
2010/8/2 0:04
Group:
Registered Users
FLServer Admins
Posts: 464
Offline
Quote:
Also, KP Lol will only work in singleplayer


Posted on: 2011/9/21 11:42
Of all things that are lost - brain I miss most
Top
Re: KP Lol plugin
Just can't stay away
Joined:
2010/10/21 16:18
Group:
Registered Users
FLServer Admins
Posts: 202
Offline
o_O !!!
So you have function to use on another player but it only works on single player ??? strange ô_Ö
it can make a good addition to flhook in MP

Posted on: 2011/9/21 12:53
Burn the gum, Not your Soul...
Top