Author Topic: [2238] FOnline: 2238 GM Abuse Tutorial  (Read 75018 times)

Offline JovankaB

  • Rotator
  • JovankaB
[2238] FOnline: 2238 GM Abuse Tutorial
« on: July 01, 2013, 02:24:39 pm »
This thread is made to answer some basic questions about administrating/game mastering a FOnline: 2238 server from inside the game (commonly known as abusing). It's assumed you already know hardcoded FOnline SDK commands and the basics about FOnline server.

Note: in the following posts the "admin" term will usually mean a person with any access level higher than player. A term "access level" will be used whenever there will be a need to make a clear distinction between different access levels of admins (tester, moder or admin).

Let's get started!

Configuring admin access: GetAccess.cfg

Before your team can start to abuse the server you have to define access settings. To do this, create a file GetAccess.cfg inside the FOnline: 2238 Server/config/ subfolder. The file should contain a list of all admins, each with own unique password and an appropriate access level. A small example how such setting for a single admin should look like inside the file:

Code: [Select]
[AdminName]
Access=admin
Password=myuniquepassword

There are three possible access levels (from the lowest to the highest): tester, moder, admin.

It is important for passwords to be unique for every admin. Although not necessary, it is advised for AdminName to be the same as the name of the character account the admin wants to use for administrative / game mastering purposes. If the character account can't be created right away, it is possible to prevent registration of a character with AdminName name by adding a line Reserved=true. It can be useful for example if you wipe a server and not all GMs are around to make an account right away. Later you can remove the blockade with command `accesslist allowregistration AdminName or simply by editing GetAccess.cfg file (however this requires server restart).

Note: The Ids of all character accounts the admin uses with ~getaccess are written automatically in GetAccess.cfg. This way you can check if someone isn't using admin access on characters they aren't supposed to.

GodOfTheRealm

There is a special admin mode scripted in FOnline: 2238 - GodOfTheRealm. Characters with this mode will be invisible for everyone else (even other people with GodOfTheRealm) and have stronger protection against being abused by other admins. This mode is given by editing return value of bool GodOfTheRealm function in the cheats.fos module. After it's done, the admin can run god function from the cheats.fos module to become GodOfTheRealm. To go back to normal mode the admin can run mortal function.

AdminLook

There is an adminlook function in cheats.fos module which can be run by people with admin access level. The function grants perfect sneaking (being able to sneak from everyone except admins) and perfect vision (seeing everyone in map except GodOfTheRealm characters). It can be also used on other characters if you know a secret number passed as the second argument of the function - use it to give adminlook to people with tester and moder access levels. Before you start your server you should change this number.

Getting Access

Getting tester/moder/admin access level works the same way as in FOnline SDK - use ~getaccess (client | tester | moder | admin) password command. The only difference is, the password is defined in GetAccess.cfg file instead of the server config file. After you type the right password you are ready to use Game Master Tools (if you set it up in the client, see the post below) and server commands!
« Last Edit: July 03, 2013, 12:35:19 pm by b__B »

Offline Wipe

  • Rotator
  • Random is god
[2238] FOnline: 2238 GM Abuse Tutorial Part 2
« Reply #1 on: July 01, 2013, 03:10:31 pm »
Game Master Tools

Game Master Tools (GMT) is a set of scripted tools available for Game Masters, which allow to do various tasks in more efficient manner. To enable GMT add following lines to FOnline2238.cfg:
Code: [Select]
[GMT]
Enabled=1

...and (re)start client. After changing access level to Tester or higher, on-screen display (OSD) should appear in top left corner of the screen minimal set of informations. After enabling all possible mini-features, OSD shows detailed information about current location, map and items/critters when you hover mouse cursor over them.
Code: [Select]
[GMT]                                                                                                                       
Enabled=1
Menu=1
Possess=1
OSDInfo=Location,Map,Critter,Item,Mouse,Hex
OSDInfoLocation=Maps,Position,Type,Extra
OSDInfoMap=Size,Faction,Owner,Size,Hex,Extra
OSDInfoCritter=Picture,Extra
OSDInfoItem=Extra
Draw=1
ItemInfo=Extra
CritterInfo=Extra


Next thing which may be interesting, is customizable menu allowing to execute server commands. It is fully configurable at client side, allowing your Game Masters to change it to their needs.
Traditional menu config, used in previous system, with famous Teleport next to Airstrike:
Code: [Select]
;;
;;Standard devmenu
;;

ONPLAYER,ONNPC;Possess;internal possess
ONPLAYER,ONNPC;Trade;runscript_unsafe dev_menu@unsafe_Trade $[Critter.Id] 0 0
ONITEM,ISCONTAINER;Browse items;runscript_unsafe dev_menu@unsafe_Trade 0 $[Item.Id] 0
ONPLAYER,ONNPC,ISALIVE;Kill;runscript_unsafe dev_menu@unsafe_KillCritter $[Critter.Id] 0 0
ONPLAYER,ONNPC,ISKNOCK;Kill;runscript_unsafe dev_menu@unsafe_KillCritter $[Critter.Id] 0 0
ONCHOSEN,ONPLAYER,ONNPC,ISDEAD;Revive;runscript_unsafe dev_menu@unsafe_KillCritter $[Critter.Id] 0 0
ONNPC;Remove critter;runscript_unsafe dev_menu@unsafe_RemoveCritter $[Critter.Id] 0 0
ONITEM;Remove item;runscript_unsafe dev_menu@unsafe_RemoveItem $[Item.Id] 0 0
ONITEM,ONGROUND;Teleport;runscript_unsafe dev_menu@unsafe_Teleport 0 $[HexX] $[HexY]
ONGROUND,NOHIDE;Airstrike;runscript dev_menu@Airstrike 0 $[HexX] $[HexY]
ONITEM,ISPOSSESS;Pick item;runscript_unsafe dev_menu@unsafe_PickItem $[Possessed.Id] $[Item.Id] 0
ONPLAYER,ONNPC,ISPOSSESS;Attack;runscript_unsafe dev_menu@unsafe_Attack $[Possessed.Id] $[Critter.Id] 0
ONGROUND,ISPOSSESS;Move to;runscript_unsafe dev_menu@unsafe_MoveTo $[Possessed.Id] $[HexX] $[HexY]
ISPOSSESS;Stop;runscript_unsafe dev_menu@unsafe_Stop $[Possessed.Id] 0 0
ONCHOSEN,ONPLAYER,ONNPC,ISKNOCK;Wake;runscript_unsafe dev_menu@unsafe_NeutralizeCritter $[Critter.Id] 0 0
ONCHOSEN,ONPLAYER,ONNPC,ISNTKNOCK;Neutralize;runscript_unsafe dev_menu@unsafe_NeutralizeCritter $[Critter.Id] 0 0
Made of three sections, each separated with ";" character, where first is set of flags defining when given button should show up, second is name, and third is command to execute. As it was revealed some time ago, it's possible to add submenu to specific buttons. To do so, replace command part with "internal menu". All next lines with single SUBMENU flag will be part of button submenu, anything else will become new top-level button.
Code: [Select]
ONPLAYER;Be Friendly;internal menu
SUBMENU;Hug;command slap -p $[Player.Id]
SUBMENU;Gift;command airstrike -p $[Player.Id]
As single menu may be not enough, it's possible to switch between them, for example you during the events/bugs-hunting/etc. Default menu, which is loaded after GMT initialization, need to be stored in file named GMTbuttons.txt. Also be noted, that all menu buttons relay on macro system (they are in fact one-line macros).

To display GMT menu, use CTRL+Click.
To switch between menus, use ~gmtools menu load FILENAME.
To reload currently used menu (after file edit), use ~gmtools menu reload.

See client_gmtools_menu.fos->CContextMenu::OnShow() for details about menu flags
See client_gmtools_macro.fos->GetVars() for details about menu $[variables]. Note that $[LastSpawned] group is parsed at server side (gmtools.fos->unsafe_question).



As communication between Game Masters online is important thing, and it may be hard to enforce one specific way of communication using external tools, GMT provides simple chat system to be used ingame. It's not meant to replace IRC/voice communication, but should be enough for some situation (like during events, or when you want to talk ingame with/as GodOfTheRealm); to use it, put "@" characted before message.
GMTchat is single feature which works for all authenticated characters, even without GMT enabled.



client_gmtools.fos
client_gmtools_menu.fos
client_gmtools_macro.fos
client_gmtools_chat.fos
gmtools_h.fos
gmtools.fos
gmtools_csc.fos
« Last Edit: July 03, 2013, 12:35:41 pm by b__B »
Games are meant to be created, not played...

Offline JovankaB

  • Rotator
  • JovankaB
[2238] FOnline: 2238 GM Abuse Tutorial Part 3
« Reply #2 on: July 01, 2013, 03:56:20 pm »
Basic Server Commands

There is around 200 server commands and dozens of scripts in various modules. A complete description is outside of the scope of this tutorial. Below you will find the basic set of commands which should help you get started with administrative duties.

Note: The parts of commands written with cursive are variables (not actual text to type but rather what kind of data should be typed there). The parts in brackets are optional. Elements mutually exclusive are in parentheses and separated with |.

Before you start - some switches are used across many commands. The most common is [-p player] switch, which let's you choose target critter (player or NPC) - player can be either critter Id (it works for NPCs too) or player name. Usually when the switch is omitted and a command requires a target, the character using the command is the target. Similar switch [-n npc] let's you choose NPC by providing NPC Id (which is equal to critter Id - 5000000), which in many cases is easier to type.

Getting Information

`alts [-l locationId] [-o]
Display IPs and characters suspected to be multilogs (sharing the same IP). -l option allows to limit the search to a specific location. By default offline characters are ignored, you can turn this behavior off with -o option.

`gameinfo infoType
Scripted equivalent of hardcoded ~gameinfo. Only infoType == 1 is implemented.

`listauthenticated
Alias: `la
Displays all authenticated characters present in the game (except those with GodOfTheRealm mode).


Moving Around

`teleport map [entire] [(-p player | -n npc)] [-x hexX -y hexY]
Alias: `tp
Teleports a critter to a specific place. The map parameter is either map Id or map alias (for example "nr" for New Reno). Full list of map aliases can be found in SetAliases function in cheats.fos module.

`teleportteam map [entire] [(-p player | -n npc)] [-x hexX -y hexY]
Works exactly like `teleport, except it teleports also players who tagged you and are near you.

`goto [(-p player | -n npc)] [-s] [-f]
Teleports to a critter. Use -s switch to be teleported in a safe distance from the critter. Use -f switch to force teleportation if the critter is on global map (by default teleporting to critters on global map is disabled).

`toglobal [(-p player | -n npc)]
Teleports a critter to global map.

`summon (-p player | -n npc)
Summons a critter to you.

`dismiss (-p player | -n npc)
Teleports the critter back where it was.

Items

`spawnitem pid count [-x hexX -y hexY] [-r radius] [-a amount] [-script module@function] [-legit]
Spawns item on ground. Amount is amount of items in a single stack, count is number of stacks. Use -legit flag (admin access only) to spawn item which can be used in normal (legit) locations. Check cheats.fos, there is more options.

`give pid count [(-p player | -n npc)] [-script module@function] [-legit]
Gives a critter an item. Check ITEMPID.H for the list of pids. Use -legit flag to spawn legit item (requires admin access level). Non-legit items can be used only in non-legit locations (locations spawned with a command without -legit option).

`pickitems
Picks all items from the hex.

`dropitems
Drops all items in inventory slot.

`clearinventory
Deletes all items inside inventory slot.

Critters

`addnpc protoId [-d dialogId] [-s module@script] [-l level] [-dir direction] [-b bagId]
Creates an NPC. The options should be quite self explanatory (there is a lot more, check cheats.fos). There are similar commands `addmob and `addfollower.

`param 0 param [value]
A command allowing to view and set your character params. Full list of params can be checked in _defines.fos.

`disguise crType [(-p player | -n npc)]
Popular command to change "skin" (critter type) of a player or an NPC. Critter types are defined in CritterTypes.cfg file.

`ces
Clears enemy stack of all critters on the map. If AI hits the fan, `ces might help.

`kill (players | npcs | all | -p player | -n npc)
Kills every player / NPC / critter in your sight or just a critter of your choice.

`reviveall
Something you want to type quickly after you missclick airstrike button.

`resetreputations [(-p player | -n npc)]
Resets all reputations of a critter.

`dropdrugs [(-p player | -n npc)]
Removes all addictions from a critter.

Locations

`createlocation pid [-legit]
Creates a location with given location pid at your global map coordinates. Use -legit flag to create a legit location (in legit locations non-legit items won't work for players).

`deletelocation
Deletes location you are in.

`disablepvp
`enablepvp
Disables / enables PvP in a map.

`disablegrids
`enablegrids
Disables / enables exit grids in a map.

Fun

`slap (-p player | -n npc) [-a actionPoints]
Slaps a player. Optionally you can decide how many action points you want to take - be careful, large values can keep player character on the ground for hours.

`massslap [-a actionPoints] [-r radius]
What is better than slapping a player? Slapping everyone in a map! Additionaly you can define how far the critters will fly (in a random direction). Warning: with large radius values players and especially NPCs (because they won't complain about it) might end up stuck in some unreachable places.
« Last Edit: July 03, 2013, 12:36:07 pm by b__B »

Offline JovankaB

  • Rotator
  • JovankaB
[2238] FOnline: 2238 GM Abuse Tutorial Part 4
« Reply #3 on: July 01, 2013, 06:48:58 pm »
Special NPCs

There is a few NPCs (or rather dialogs) of special purpose which you might find useful at some point (for example to make events or for testing).

`addnpc 170 -d 10799 -l 9999
Low tech outfitter.

`addnpc 486 -d 10809 -l 9999
High tech outfitter.

`addnpc 278 -d 10802 -l 9999
Altruist (gives free XP and money).

`addnpc 251 -s vaul_guard@critter_init -l 9999 -r 1 -b 191
Event Enclave guard with sniper rifle.

`addnpc 454 -d 2530 -s npc_shouter@critter_init -role 5 -a 238 -b 1 -t 9000
Hub Arena shouter. He shouts that a fighting event in the Hub Arena is taking place. Talking to him gives the option to teleport directly into the arena. (Was meant to be placed on every corner in the Hub when fight events are taking place).


Finally there is a special command to make a teleporter NPC:

`teleporter -map mapId -tx targetHexX -ty targetHexY [-x hexX] [-y hexY] [-dir direction] [-it]
Teleporter Goris. Will teleport players to a map at specified coordinates. Use -it flag to allow teleportation with items.
« Last Edit: July 03, 2013, 12:36:18 pm by b__B »

Offline JovankaB

  • Rotator
  • JovankaB
[2238] FOnline: 2238 GM Abuse Tutorial Part 5
« Reply #4 on: July 01, 2013, 07:38:07 pm »
Item/Location legitimacy system

Every item and map in the game is either legit or not legit. All items and locations created by standard game features are considered legit.

Items spawned with GM commands, are not legit, unless you use -legit switch in the commands. The switch can be used only with admin access level, in following commands:
  • createlocation
  • give
  • givekey
  • spawncar
  • spawnitem
In case of items, the -legit switch should be used ONLY when you spawn an item which is supposed to be 100% legal part of the game, used by all players however they want. The same goes for locations.

Legit item behavior

Spawned legit items and locations behave like any other legit item and location in the game.

Not legit item behavior

Spawned not legit items can be used by authenticated staff (tester access and higher) anywhere without most restrictions . By non-authenticated players they can be used without restrictions only inside not legit locations. There is a small exception for stackable items. Even in not legit location, stackable not legit items can't be picked up or used if player holds a legit item of the same kind (to prevent merging not legit stacks into legit stacks).

Not legit items can't be disassembled (not even in not legit locations).

You should still take all possible precautions when spawning items (the system helps prevent the most common mistakes, but it's far from perfect and there are many loopholes in it).
« Last Edit: July 03, 2013, 12:36:25 pm by b__B »

Offline JovankaB

  • Rotator
  • JovankaB
Re: [2238] FOnline: 2238 GM Abuse Tutorial
« Reply #5 on: July 02, 2013, 09:00:36 pm »
The tutorial will stay open, if you have some questions about gm commands and similar topics, ask here.
« Last Edit: July 03, 2013, 12:37:15 pm by b__B »

Re: [FOnline: 2238] GM Abuse Tutorial
« Reply #6 on: July 03, 2013, 12:20:37 am »
Everything works fine except the OSD menu/commands. Nothing happens when I change access.

Re: [FOnline: 2238] GM Abuse Tutorial
« Reply #7 on: July 03, 2013, 12:42:15 am »
Everything works fine except the OSD menu/commands. Nothing happens when I change access.
try this one (use save as)
You might've left space in the end of the line.
« Last Edit: July 03, 2013, 12:48:33 am by Wire »
The sky above the port was the color of television, tuned to a dead channel.
irc V_guessWho

Re: [FOnline: 2238] GM Abuse Tutorial
« Reply #8 on: July 03, 2013, 06:03:46 am »
Hmm, nothing seems to be working for me.  As far as I can tell I followed the first set of directions to the T. 

~getaccess password

Returns nothing.  No commands work, GMT is not displaying.  Any ideas?

Offline JovankaB

  • Rotator
  • JovankaB
Re: [2238] FOnline: 2238 GM Abuse Tutorial
« Reply #9 on: July 03, 2013, 06:08:46 am »
whoops, sorry, it should be (following the command syntax styling I used in the tutorial):
~getaccess (client | tester | moder | admin) password

Just like in FOnline SDK.
So for the highest access level (testers and moders can't use all commands) it would be: ~gettaccess admin yourpasswordhere
« Last Edit: July 03, 2013, 12:37:30 pm by b__B »

Re: [FOnline: 2238] GM Abuse Tutorial
« Reply #10 on: July 03, 2013, 06:13:14 am »
whoops, sorry, it should be (following the command syntax styling I used in the tutorial):
~getaccess (client | tester | moder | admin) password

Just like in FOnline SDK.
So for the highest access level (testers and moders can't use all commands) it would be: ~gettaccess admin yourpasswordhere
Awesome, it worked :).  Everything is good now :).

Offline Wipe

  • Rotator
  • Random is god
Re: [FOnline: 2238] GM Abuse Tutorial
« Reply #11 on: July 03, 2013, 08:02:36 am »
To display GMT menu, use CTRL+Click.
Lazy dev forgot to add it, so i did :'(
« Last Edit: July 03, 2013, 08:19:37 am by Wipe »
Games are meant to be created, not played...

Re: [FOnline: 2238] GM Abuse Tutorial
« Reply #12 on: July 03, 2013, 08:33:20 am »
I have a problem with getacess admin commands, it is stupid but I do not sure if I make it properly.

GetAccess.cfg (it is the same folder where are FOnlineServer and FOnlineServer.cfg).

GetAccess.cfg:
Code: [Select]
[Admin1]
Access=admin
Password=123

FOnlineServer.cfg:
Code: [Select]
# Keys for accesses
# Aviable four access mode: client (default on login), tester, moder, admin
Access_client=123
Access_tester=123
Access_moder=123
Access_admin=123
AccessNames_admin=Admin1

In game command ~getaccess admin 123 and "access denied".

Offline JovankaB

  • Rotator
  • JovankaB
Re: [2238] FOnline: 2238 GM Abuse Tutorial
« Reply #13 on: July 03, 2013, 08:39:28 am »
No, GetAccess.cfg should be created in Server/config/ subfolder, here:

https://github.com/rotators/fo2238/tree/master/Server/config
« Last Edit: July 03, 2013, 12:37:37 pm by b__B »

Re: [FOnline: 2238] GM Abuse Tutorial
« Reply #14 on: July 03, 2013, 11:40:48 am »
Found a bug  ;D.. if DisplayTCZone is set to 2 the admin osd will not work.