evilsquirrel said:Game stopping error:
Could not release P-buffer from render texture
AND
Could not bind P-buffer to render texture
restart fixed this issue, to let everybody know
evilsquirrel said:Game stopping error:
Could not release P-buffer from render texture
AND
Could not bind P-buffer to render texture
villager said:I get that Error whenever I try to start my server :S
//Black chest, the revenge
//- new string and token handling might simplify this mess, or 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
setvard IMMUNE_PUSH 1
setvard PLAYING_DEAD 1
fly 1
gravity 0
setsolid none
setprop ent_me rendermode 5
setprop ent_me renderamt 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
consolemsg DEV_PLAYER ARTY_DEBUG: ARTIFIACT_DEBUG full_inventory:
consolemsg DEV_PLAYER ARTY_DEBUG: - items: IBC_ITEM_LIST
consolemsg DEV_PLAYER ARTY_DEBUG: - names: 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
local PLAYER_SUB_STAT $get(CUR_PLAYER,scriptvar,PLR_DMG) //fraction points
multiply PLAYER_SUB_STAT 0.001
add PLAYER_STAT PLAYER_SUB_STAT
if ( G_DEVELOPER_MODE ) consolemsg DEV_PLAYER ARTY_DEBUG: reading PLAYER_STAT dmgpoints on $get(CUR_PLAYER,name)
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
callevent 10.0 resend_menu
}
{ game_menu_getoptions
setvard CUR_USER PARAM1
setvard LAST_SKIPPED_ITEM -1
setvard LOOP_ITEMS_OFFERED 0
calleventloop $get_token_amt(IBC_ITEM_LIST) list_items
//player already has every item we offered
//offer him a duplicate anyways (ie. the last item skipped)
if LOOP_ITEMS_OFFERED == 0
local reg.mitem.title $get_token(IBC_ITEM_NAMES,LAST_SKIPPED_ITEM)
local reg.mitem.type callback
local reg.mitem.data LAST_SKIPPED_ITEM
local reg.mitem.callback give_item
menuitem.register
}
{ list_items
local CUR_IDX game.script.iteration
local CUR_ITEM_NAME $get_token(IBC_ITEM_NAMES,CUR_IDX)
local CUR_ITEM $get_token(IBC_ITEM_LIST,CUR_IDX)
//user already has item, skip it
if ( $item_exists(CUR_USER,CUR_ITEM) )
{
local SKIP_ITEM 1
setvard LAST_SKIPPED_ITEM CUR_IDX
}
else
{
add LOOP_ITEMS_OFFERED 1
}
if !SKIP_ITEM
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
callexternal THE_CHOSEN_ONE ext_last_artie_used $get(ent_me,id) //mark owner has having used me
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 - oops, handled when we choose next winner
callevent 2.0 next_winner
}
{ give_item //<prize_winner> <item_idx>
callexternal PARAM1 ext_last_artie_used $get(ent_me,id) //mark owner has having used me
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 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 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
}
{ resend_menu
if $get(THE_CHOSEN_ONE,isplayer) //still here
if $get(THE_CHOSEN_ONE,scriptvar,PLR_LAST_ARTIE) isnot $get(ent_me,id) //hasnt used me yet
//send menu again
menu.open THE_CHOSEN_ONE
callevent 10.0 resend_menu
}
but one piece of coding theory I stick to is: run functions as few times as possible in your code.