[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4866: Undefined array key "database_gc"
Where is the player "registered"? - FOSS gamedev and creative worlds

Where is the player "registered"?

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52

Where is the player "registered"?

by InfinityProject » Fri Jul 20, 2012 19:54

Hey guys I was wanting to begin some mods that will edit the player itself. However, I don't know in what file the player is registered. I heard it's in c++. Where is info like this stored i.e. tile_images= visual_scale= ?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Jul 22, 2012 17:24

You can not modify the player with a lua mod (only the inventory). These are the methods you can use on a player with the modding api:
- remove(): remove object (after returning from Lua)
- getpos() -> {x=num, y=num, z=num}
- setpos(pos); pos={x=num, y=num, z=num}
- moveto(pos, continuous=false): interpolated move
- punch(puncher, time_from_last_punch, tool_capabilities, direction)
^ puncher = an another ObjectRef,
^ time_from_last_punch = time since last punch action of the puncher
- right_click(clicker); clicker = an another ObjectRef
- get_hp(): returns number of hitpoints (2 * number of hearts)
- set_hp(hp): set number of hitpoints (2 * number of hearts)
- get_inventory() -> InvRef
- get_wield_list(): returns the name of the inventory list the wielded item is in
- get_wield_index(): returns the index of the wielded item
- get_wielded_item() -> ItemStack
- set_wielded_item(item): replaces the wielded item, returns true if successful
- set_armor_groups({group1=rating, group2=rating, ...})
- set_properties(object property table)
- is_player(): true for players, false for others
- get_player_name(): returns "" if is not a player
- get_look_dir(): get camera direction as a unit vector
- get_look_pitch(): pitch in radians
- get_look_yaw(): yaw in radians (wraps around pretty randomly as of now)
- set_inventory_formspec(formspec)
^ Redefine player's inventory form
^ Should usually be called in on_joinplayer
- get_inventory_formspec() -> formspec string

(copied from doc/lua-api.txt)
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 18 guests

cron