- Admin
- #1
In response to this crap I have decided to come up with yet another artifact systemâ¦
This is my idear:
- Artifact chest spawns, sorts through its items based solely on the number of players
- Some items require X# of players, the rest merely have spawn chances multiplied by # of players present
- To clarify: ANY number of players present will increase spawn chances, this new style artifact wonât care about hitpoints, time on, or what not
After the artifact chest sorts that out, it will decide who gets what â but instead of by strength, it will choose by who got the most âdamage pointsâ:
Damge Points:
To encourage cooperative game play â âdamage pointsâ will be awarded for healing other players (+100) and ice shielding other players (+1000). You will get various obscene amounts of damage points for other aiding activities as they become available, in addition to the obvious: for doing damage to enemies. (And no, beating your summons or fellow players will not count.) You will also lose 1000 damage points for death, regardless of how it came about.
The game master will keep track of your damage points and tie them to a steamed. Every time you get more than 1000 damage points, the game_master will be updated, and your playerâs personal counter will reset. This should prevent overflows from gathering huge amounts of damage points on a single map, and will allow you to keep damage points if you get disconnected.
â¦okay⦠Now the fun part.
Instead of picking an item randomly, the artifact chest will give the player with the most damage points a pop-up menu, listing all the items it contains.
The player will not have to go to the chest, the pop-up menu will come up wherever he maybe, and the item he chooses from the list will pop-up in his hands, wherever he maybe.
After he chooses his item, the artifact chest will choose the next player with the next most damage points, and so on, and so forth, until its passed out all the items it has to give, or runs out of players to give them to. (one item per player)
This is the first draft of the code:
Potential abuse:
The few potential abuses I see are all reportable, and would result in removal from FN server auth, theyâd include:
- Bots: This wouldnât actually work, as the player filter is smart enough to detect bots, but since the chat bug is fixed in next release, and thus there is no reason for them, bots will be illegal on FN
- Kicking the most active player at the last second: If this happens, report it. We will remove FN auth. If the strongest player gets kicked after the chest spawns, it will lock.
- Logging on with multiple steam accounts to increase spawn chances: This I canât do much about. I donât think itâs worth bringing in HP/AFK requirements to prevent though, as they will just complicated the code. If I see it happening, or get reports of such Iâll risk it, but for now, Iâm trying to KISS this, as the artifact chests are notoriously buggy.
Ideas? Suggestions? Opinions? Discuss:
edits: code update
This is my idear:
- Artifact chest spawns, sorts through its items based solely on the number of players
- Some items require X# of players, the rest merely have spawn chances multiplied by # of players present
- To clarify: ANY number of players present will increase spawn chances, this new style artifact wonât care about hitpoints, time on, or what not
After the artifact chest sorts that out, it will decide who gets what â but instead of by strength, it will choose by who got the most âdamage pointsâ:
Damge Points:
To encourage cooperative game play â âdamage pointsâ will be awarded for healing other players (+100) and ice shielding other players (+1000). You will get various obscene amounts of damage points for other aiding activities as they become available, in addition to the obvious: for doing damage to enemies. (And no, beating your summons or fellow players will not count.) You will also lose 1000 damage points for death, regardless of how it came about.
The game master will keep track of your damage points and tie them to a steamed. Every time you get more than 1000 damage points, the game_master will be updated, and your playerâs personal counter will reset. This should prevent overflows from gathering huge amounts of damage points on a single map, and will allow you to keep damage points if you get disconnected.
â¦okay⦠Now the fun part.
Instead of picking an item randomly, the artifact chest will give the player with the most damage points a pop-up menu, listing all the items it contains.
The player will not have to go to the chest, the pop-up menu will come up wherever he maybe, and the item he chooses from the list will pop-up in his hands, wherever he maybe.
After he chooses his item, the artifact chest will choose the next player with the next most damage points, and so on, and so forth, until its passed out all the items it has to give, or runs out of players to give them to. (one item per player)
This is the first draft of the code:
Code:
//Black chest, the revenge
//- new string and token handling might simplify this mess, so I thought
{
const ANIM_IDLE idle
const ANIM_CLOSE close
const ANIM_OPEN open
const LIGHT_COLOR (200,200,255)
const LIGHT_RAD 96
}
{ game_spawn
//spawn invisible
hp 1
invincible 2
name ''
width 20
height 30
setmodel misc/treasure.mdl
setmodelbody 0 1
setidleanim ANIM_IDLE
setsolid none
setprop ent_me rendermode 5
setprop ent_me renderamt 0
setvard BC_DISCONNECTS 0
}
{ game_dynamically_created //<token_items> <token_chances> <token_req_players> <token_disp_names>
setvard IBC_ITEM_LIST PARAM1
setvard IBC_ITEM_CHANCES PARAM2
setvard IBC_REQ_PLAYERS PARAM3
setvard IBC_ITEM_NAMES PARAM4
if ( IBC_ITEM_LIST startswith 'PARAM' ) infomsg all "THOTH FUCKED UP (Artifact Chest)" "Dude, artifact this chest has no items!"
if ( IBC_ITEM_CHANCES startswith 'PARAM' ) infomsg all "THOTH FUCKED UP (Artifact Chest)" "Artifact this chest no spawn chances!"
if ( IBC_REQ_PLAYERS startswith 'PARAM' ) infomsg all "THOTH FUCKED UP (Artifact Chest)" "Artifact this chest no req players!"
if ( IBC_ITEM_NAMES startswith 'PARAM' ) infomsg all "THOTH FUCKED UP (Artifact Chest)" "Artifact chest items have no names!"
if ( PARAM8 isnot 'PARAM8' ) setvard FACE_YAW $vec.yaw(PARAM8) //compatiblity
setvard ARTIFIACT_DEBUG "ARTIFACT_CHEST ("
stradd ARTIFIACT_DEBUG game.map.name
stradd ARTIFIACT_DEBUG "):"
if ( game.cvar.ms_chatlog ) chatlog $timestamp(>) ARTIFIACT_DEBUG full_inventory: IBC_ITEM_NAMES req_players: IBC_REQ_PLAYERS spawn_chances: IBC_ITEM_CHANCES
getplayersnb PLAYER_LIST
setvard N_PLAYERS $get_token_amt(PLAYER_LIST)
callevent 0.1 filter_items
if G_DEVELOPER_MODE
setvard DEV_PLAYER ''
getplayer DEV_PLAYER 1
if ( G_DEVELOPER_MODE )
{
consolemsg DEV_PLAYER ARTY_DEBUG: ARTIFIACT_DEBUG full_inventory:
consolemsg DEV_PLAYER ARTY_DEBUG: - items: IBC_ITEM_NAMES
consolemsg DEV_PLAYER ARTY_DEBUG: - players: IBC_REQ_PLAYERS
consolemsg DEV_PLAYER ARTY_DEBUG: - chances: IBC_ITEM_CHANCES
}
}
{ filter_items
if ( FACE_YAW isnot 'FACE_YAW' ) setangle face $vec(0,FACE_YAW,0)
//remove items that fail spawn chances, or there are not enough players for
setvard REMOVE_ITEMS ''
calleventloop $get_token_amt(IBC_ITEM_LIST) filter_items_loop
if ( $get_token_amt(REMOVE_ITEMS) == $get_token_amt(IBC_ITEM_LIST) )
{
if ( game.cvar.ms_chatlog ) chatlog $timestamp(>) ARTIFIACT_DEBUG Removed: all items failed spawn chance rolls.
deleteent ent_me //got nadda
local EXIT_SUB 1
}
if !EXIT_SUB
callevent 0.1 remove_items //give a sec for strings to propigate
}
{ filter_items_loop
local CUR_IDX game.script.iteration
local CUR_ITEM_REQ_PLAYERS $get_token(IBC_REQ_PLAYERS,CUR_IDX)
if ( N_PLAYERS < CUR_ITEM_REQ_PLAYERS )
{
local REMOVE_ITEM 1
if G_DEVELOPER_MODE
consolemsg DEV_PLAYER ARTY_DEBUG: CUR_IDX ( $get_token(IBC_ITEM_LIST,CUR_IDX) ) marked for removal (player req)
}
local CUR_ITEM_SPAWNCHANCE $get_token(IBC_ITEM_CHANCES,CUR_IDX)
multiply CUR_ITEM_SPAWNCHANCE N_PLAYERS
if ( $rand(1,100) > CUR_ITEM_SPAWNCHANCE )
{
local REMOVE_ITEM 1
if G_DEVELOPER_MODE
consolemsg DEV_PLAYER ARTY_DEBUG: CUR_IDX ( $get_token(IBC_ITEM_LIST,CUR_IDX) ) marked for removal (spawn chance)
}
if REMOVE_ITEM
token.add REMOVE_ITEMS $get_token(IBC_ITEM_LIST,CUR_IDX)
}
{ remove_items
if ( G_DEVELOPER_MODE ) consolemsg DEV_PLAYER ARTY_DEBUG: Remove_item_list: REMOVE_ITEMS
calleventloop $get_token_amt(REMOVE_ITEMS) remove_items_loop
if ( game.cvar.ms_chatlog ) chatlog $timestamp(>) ARTIFIACT_DEBUG final_inventory: IBC_ITEM_NAMES req_players: IBC_REQ_PLAYERS spawn_chances: IBC_ITEM_CHANCES
if ( G_DEVELOPER_MODE )
{
consolemsg DEV_PLAYER ARTY_DEBUG: ARTIFIACT_DEBUG final_inventory:
consolemsg DEV_PLAYER ARTY_DEBUG: - items: IBC_ITEM_NAMES
consolemsg DEV_PLAYER ARTY_DEBUG: - players: IBC_REQ_PLAYERS
consolemsg DEV_PLAYER ARTY_DEBUG: - chances: IBC_ITEM_CHANCES
}
callevent 0.5 choose_player
}
{ remove_items_loop
local CUR_IDX game.script.iteration
local ITEM_TO_REMOVE $get_token(REMOVE_ITEMS,CUR_IDX)
local REMOVE_IDX $get_find_token(IBC_ITEM_LIST,ITEM_TO_REMOVE)
if ( G_DEVELOPER_MODE ) consolemsg DEV_PLAYER ARTY_DEBUG: Removing ( $get_token(IBC_ITEM_LIST,REMOVE_IDX) )
//doing this from here, rather than callevent remove_item, to be safer
token.del IBC_ITEM_LIST REMOVE_IDX
token.del IBC_ITEM_CHANCES REMOVE_IDX
token.del IBC_REQ_PLAYERS REMOVE_IDX
token.del IBC_ITEM_NAMES REMOVE_IDX
}
{ choose_player
setvard STRONGEST_IDX 0
setvard STRONGEST_STAT_LEVEL 0
calleventloop $get_token_amt(PLAYER_LIST) find_strongest_player
setvard THE_CHOSEN_ONE $get_token(PLAYER_LIST,STRONGEST_IDX)
setvard THE_CHOSEN_ONE_IDX STRONGEST_IDX
token.del PLAYER_LIST STRONGEST_IDX
callevent inform_player
}
{ find_strongest_player
local CUR_IDX game.script.iteration
local CUR_PLAYER $get_token(PLAYER_LIST,CUR_IDX)
local PLAYER_STAT $get(CUR_PLAYER,scriptvar,PLR_TOTAL_DMG) //newfunc in player_main/game_master +1000 for heal/iceshield -1000 for death
if ( PLAYER_STAT > STRONGEST_STAT_LEVEL )
{
setvard STRONGEST_STAT_LEVEL PLAYER_STAT
setvard STRONGEST_IDX CUR_IDX
}
}
{ inform_player
if ( !I_MANIFESTED )
{
//I have items, manifest
name Artifact Chest
playsound 0 10 magic/spawn.wav
setvard I_MANIFESTED 1
clientevent persist all monsters/lighted_cl $get(ent_me,index) LIGHT_COLOR LIGHT_RAD
setvard MY_LIGHT_IDX game.script.last_sent_id
callexternal GAME_MASTER gm_fade_in $get(ent_me,id) 5
}
infomsg THE_CHOSEN_ONE "ARTIFACT CHEST: YOU HAVE BEEN CHOSEN!" "Select and item of your choosing..."
playanim hold ANIM_OPEN
menu.open THE_CHOSEN_ONE
}
{ game_menu_getoptions
calleventloop $get_token_amt(IBC_ITEM_LIST) list_items
}
{ list_items
local CUR_IDX game.script.iteration
local CUR_ITEM_NAME $get_token(IBC_ITEM_NAMES,CUR_IDX)
local reg.mitem.title CUR_ITEM_NAME
local reg.mitem.type callback
local reg.mitem.data CUR_IDX
local reg.mitem.callback give_item
menuitem.register
}
{ game_menu_cancel
//player clicked cancel on the pop-up menu
local RESP_STRING $get(PARAM1,name)
strconc RESP_STRING " " has declined to partake in the bounty
infomsg all "ARTIFACT CHEST" RESP_STRING
playanim once ANIM_CLOSE
token.del PLAYER_LIST THE_CHOSEN_ONE_IDX //remove player from list
callevent 2.0 next_winner
}
{ give_item //<prize_winner> <item_idx>
if ( G_DEVELOPER_MODE ) consolemsg DEV_PLAYER ARTY_DEBUG: Menu Select PARAM2
local CUR_ITEM $get_token(IBC_ITEM_LIST,PARAM2)
local CUR_ITEM_NAME $get_token(IBC_ITEM_NAMES,PARAM2)
offer PARAM1 CUR_ITEM
local RESP_STRING $get(PARAM1,name)
strconc RESP_STRING " " has recieved a CUR_ITEM_NAME from an Artifact Chest. (NO ROLLING!)
infomsg all "ARTIFACT CHEST" RESP_STRING
if ( game.cvar.ms_chatlog ) chatlog $timestamp(>) ARTIFIACT_DEBUG $get(PARAM1,name) chose a CUR_ITEM_NAME
local ITEM_IDX PARAM2
callevent remove_item ITEM_IDX
token.del PLAYER_LIST THE_CHOSEN_ONE_IDX //remove player from list
playanim once ANIM_CLOSE
callevent 2.0 next_winner
}
{ next_winner
if ( $get_token_amt(IBC_ITEM_LIST) == 0 )
{
callevent fade_away //out of stuff
local ALL_DONE 1
}
if ( $get_token_amt(PLAYER_LIST) == 0 )
{
callevent fade_away //out of players
local ALL_DONE 1
}
if !ALL_DONE
callevent 1.0 choose_player
}
{ remove_item //<item_idx>
token.del IBC_ITEM_LIST PARAM1
token.del IBC_ITEM_CHANCES PARAM1
token.del IBC_REQ_PLAYERS PARAM1
token.del IBC_ITEM_NAMES PARAM1
}
{ fade_away
//passed out everything I had, or ran out of players to pass stuff to, fade out
playsound 0 10 magic/spawn.wav
clientevent remove all MY_LIGHT_IDX
callexternal GAME_MASTER gm_fade_out $get(ent_me,id)
callevent 3.0 fade_away2
}
{ fade_away2
deleteent ent_me
}
Potential abuse:
The few potential abuses I see are all reportable, and would result in removal from FN server auth, theyâd include:
- Bots: This wouldnât actually work, as the player filter is smart enough to detect bots, but since the chat bug is fixed in next release, and thus there is no reason for them, bots will be illegal on FN
- Kicking the most active player at the last second: If this happens, report it. We will remove FN auth. If the strongest player gets kicked after the chest spawns, it will lock.
- Logging on with multiple steam accounts to increase spawn chances: This I canât do much about. I donât think itâs worth bringing in HP/AFK requirements to prevent though, as they will just complicated the code. If I see it happening, or get reports of such Iâll risk it, but for now, Iâm trying to KISS this, as the artifact chests are notoriously buggy.
Ideas? Suggestions? Opinions? Discuss:
edits: code update