//Awareness On Mouse-Over
//Author: codave
#include "_macros.fos"
#include "_client_defines.fos"
#include "_colors.fos"
#include "_msgstr.fos"
void InitAwarenessHead() // Export
{
CritterCl@ cr = GetMonitorCritter(__MouseX, __MouseY);
if( !valid(cr) )
return;
ItemCl@ item = cr.GetItem( 0, SLOT_HAND1 );
ItemCl@ itemArmor = cr.GetItem( 0, SLOT_ARMOR );
int hp_amo = cr.Stat[ ST_CURRENT_HP ];
if(valid(cr) )
{
int Y=__MouseY;
int hp_proc = cr.Stat[ ST_CURRENT_HP ] * 100 / cr.Stat[ ST_MAX_LIFE ];
if(_CritIsInjured(cr))
{
if (hp_proc < 1)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE]+", Injured", __MouseX, Y-60, 500, 100, COLOR_LGRAY, FONT_FALLOUT, FT_BORDERED);
else if (hp_proc < 25)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE]+", Injured", __MouseX, Y-60, 500, 100, COLOR_RED, FONT_FALLOUT, FT_BORDERED);
else if (hp_proc < 50)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE]+", Injured", __MouseX, Y-60, 500, 100, COLOR_DRED, FONT_FALLOUT, FT_BORDERED);
else if (hp_proc <= 75)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE]+", Injured", __MouseX, Y-60, 500, 100, COLOR_DGREEN, FONT_FALLOUT, FT_BORDERED);
else if (hp_proc <= 100)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE]+", Injured", __MouseX, Y-60, 500, 100, 0x0, FONT_FALLOUT, FT_BORDERED);
Y=Y+13;
}
else
{
if (hp_proc < 1)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE], __MouseX, Y-60, 500, 100, COLOR_LGRAY, FONT_FALLOUT, FT_BORDERED);
else if (hp_proc < 25)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE], __MouseX, Y-60, 500, 100, COLOR_RED, FONT_FALLOUT, FT_BORDERED);
else if (hp_proc < 50)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE], __MouseX, Y-60, 500, 100, COLOR_DRED, FONT_FALLOUT, FT_BORDERED);
else if (hp_proc <= 75)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE], __MouseX, Y-60, 500, 100, COLOR_DGREEN, FONT_FALLOUT, FT_BORDERED);
else if (hp_proc <= 100)
DrawText (cr.Stat[ST_CURRENT_HP]+"/"+cr.Stat[ST_MAX_LIFE], __MouseX, Y-60, 500, 100, 0x0, FONT_FALLOUT, FT_BORDERED);
Y=Y+13;
}
if(valid(itemArmor))
{
DrawText (""+GetMsgStr(TEXTMSG_ITEM, STR_ITEM_INFO(itemArmor)), __MouseX, Y-60, 500, 100, 0x0, FONT_FALLOUT, FT_BORDERED);
Y=Y+13;
}
else
{
DrawText ("No Armor", __MouseX, Y-60, 500, 100, COLOR_LGRAY, FONT_FALLOUT, FT_BORDERED);
Y=Y+13;
}
if(valid(item))
{
DrawText (""+GetMsgStr(TEXTMSG_ITEM, STR_ITEM_INFO(item)), __MouseX, Y-60, 500, 100, 0x0, FONT_FALLOUT, FT_BORDERED);
}
else
{
DrawText ("Unarmed", __MouseX, Y-60, 500, 100, COLOR_LGRAY, FONT_FALLOUT, FT_BORDERED);
}
}
}
#include "_client_defines.fos"
#include "_macros.fos"
#include "_msgstr.fos"
#include "sprite.fos"
#include "_colors.fos"
#include "_animation.fos"
#include "awareness.fos"
GUI_Init();
InitNameColorizing();
InitIgnoreList();
// InitTestScreen();
InitRadioScreen();
InitChosenTabs();
InitAwarenessHead();
#ifdef PLAYERS_3D
Init3DChaRegScreen();
#endif
void render_iface( uint layer )
{
if(layer == 1 )
{
CritterCl@ chosen = GetChosen();
if(valid(chosen) && chosen.Perk[PE_AWARENESS] != 0)
{
InitAwarenessHead();
}
}
if( layer == 3 )
{
DrawChosenTabs();
GUI_Render();
}
Code: [Select]CritterCl@ cr = GetMonitorCritter(__MouseX, __MouseY);
ItemCl@ item = cr.GetItem( 0, SLOT_HAND1 );
ItemCl@ itemArmor = cr.GetItem( 0, SLOT_ARMOR );
int hp_amo = cr.Stat[ ST_CURRENT_HP ];
if( !valid(cr) ) return;
#include "_defines.fos"
#include "_client_defines.fos"
#include "_colors.fos"
import int GUI_GetActiveMainScreen() from "client_gui";
#define GUI_ONHEAD_NB_MOD 4 //Number of mod that we can switch
#define GUI_ONHEAD_EMPTY 0 //Show nothing
#define GUI_ONHEAD_NAME 1 //Show the name
#define GUI_ONHEAD_DETAILS 2 //Show the name and HP
#define GUI_ONHEAD_DEBUG 3 //Show the name, id and pid
//global variable to store the current mod
uint GUI_OnHead_Mod;
//Initialize all that we need to initialize
void Init_GUI_OnHead()
{
GUI_OnHead_Mod = GUI_ONHEAD_EMPTY;
}
//Draw function where we change informations on head
void Draw_GUI_OnHead()
{
if( GUI_GetActiveMainScreen() != CLIENT_MAIN_SCREEN_GAME )
return;
CritterCl@ cr = GetChosen();
CritterCl@[] crs;
GetCritters( 0, FIND_ALL, crs );
switch(GUI_OnHead_Mod)
{
case GUI_ONHEAD_EMPTY:
for(uint i = 0, imax = crs.length(); i < imax; i ++)
{
crs[i].NameOnHead = "";
}
__ShowPlayerNames = false;
break;
case GUI_ONHEAD_NAME:
for(uint i = 0, imax = crs.length(); i < imax; i ++)
{
crs[i].NameOnHead = "";
}
__ShowPlayerNames = true;
break;
case GUI_ONHEAD_DETAILS:
{
int color_b = 0;
int color_g = 0;
int color_r = 0;
for(uint i = 0, imax = crs.length(); i < imax; i ++)
{
color_g = (255*crs[i].Param[ST_CURRENT_HP])/crs[i].Param[ST_MAX_LIFE];
if(color_g < 0)
color_g = 0;
color_r = 255 - color_g;
crs[i].NameOnHead = crs[i].Name + "\n|" + COLOR_RGB(color_r, color_g, color_b) + " " + crs[i].Param[ST_CURRENT_HP] + "/" + crs[i].Param[ST_MAX_LIFE];
}
__ShowPlayerNames = true;
break;
}
case GUI_ONHEAD_DEBUG:
for(uint i = 0, imax = crs.length(); i < imax; i ++)
{
crs[i].NameOnHead = crs[i].Name + "\n|" + COLOR_CONTOUR_YELLOW + " Id : " + crs[i].Id + "\nPid : " + crs[i].Pid;
}
__ShowPlayerNames = true;
break;
default :
GUI_OnHead_Mod = GUI_ONHEAD_EMPTY;
break;
}
}
//Called when we push F6
void Change_GUI_OnHead()
{
GUI_OnHead_Mod = (GUI_OnHead_Mod + 1) % GUI_ONHEAD_NB_MOD;
}
//Called when we push F7
void ShowNPC_GUI_OnHead()
{
__ShowNpcNames = !__ShowNpcNames;
}
import void Init_GUI_OnHead() from "client_gui_onhead";
import void Draw_GUI_OnHead() from "client_gui_onhead";
import void Change_GUI_OnHead() from "client_gui_onhead";
import void ShowNPC_GUI_OnHead() from "client_gui_onhead";
...
bool start()
{
...
Init_GUI_OnHead();
...
}
...
void render_iface( uint layer )
{
...
if( layer == 3 )
{
...
Draw_GUI_OnHead();
...
}
...
}
...
bool key_down( uint8 key )
{
...
if(key == DIK_F6)
{
Change_GUI_OnHead();
return true;
}
if(key == DIK_F7)
{
ShowNPC_GUI_OnHead();
return true;
}
...
}
...
//On-Screen Timeouts
//By: codave
#include "_macros.fos"
#include "_client_defines.fos"
#include "_colors.fos"
#include "_msgstr.fos"
#include "_defines.fos"
import int GUI_GetActiveMainScreen() from "client_gui";
import int GUI_GetActiveScreen() from "client_gui";
void InitTimeouts()
{
if( GUI_GetActiveMainScreen() != CLIENT_MAIN_SCREEN_GAME )
return;
CritterCl@ chosen = GetChosen();
if( not valid( chosen ) )
return;
int Y=30;
int X=10;
if( chosen.Timeout[ TO_SK_LOCKPICK ] > 0 )
{
DrawText("Lockpick: "+chosen.Timeout[ TO_SK_LOCKPICK ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_SK_FIRST_AID ] > 0 )
{
DrawText("First Aid: "+chosen.Timeout[ TO_SK_FIRST_AID ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_SK_DOCTOR ] > 0 )
{
DrawText("Doctor: "+chosen.Timeout[ TO_SK_DOCTOR ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_SK_REPAIR ] > 0 )
{
DrawText("Repair: "+chosen.Timeout[ TO_SK_REPAIR ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_BATTLE ] > 0 && chosen.Timeout[ TO_BATTLE ] < 10000 )
{
DrawText("Battle: "+chosen.Timeout[ TO_BATTLE ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_REPLICATION ] > 0 )
{
DrawText("Respawn Time: "+chosen.Timeout[ TO_REPLICATION ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
if( chosen.Timeout[ TO_SK_STEAL ] > 0 )
{
DrawText("Steal: "+chosen.Timeout[ TO_SK_STEAL ] / 10, X, Y-0, 500, 100, COLOR_GREEN, FONT_FALLOUT, FT_BORDERED );
Y=Y+15;
}
}
// Author: cvet, Atom
// Client main script
// Compile using fo_client.dll
#include "_client_defines.fos"
#include "_macros.fos"
#include "_msgstr.fos"
#include "sprite.fos"
#include "_colors.fos"
#include "_animation.fos"
#include "awareness.fos"
#include "timeouts.fos"
GUI_Init();
InitNameColorizing();
InitIgnoreList();
// InitTestScreen();
InitRadioScreen();
InitChosenTabs();
InitAwarenessHead();
InitTimeouts();
#ifdef PLAYERS_3D
Init3DChaRegScreen();
#endif
if( layer == 3 )
{
InitTimeouts();
DrawChosenTabs();
GUI_Render();
}
Script::BindImportedFunctions - Fail to bind imported functions, module<client_main>, error<-19>.
it means, that something does wrong when server trying to execute one of important function from awareness.fos or/and timeouts.fos before compilingCode: [Select]Script::BindImportedFunctions - Fail to bind imported functions, module<client_main>, error<-19>.
I know it has something to do with the imports :/ but what?
#include "awareness.fos"
#include "timeouts.fos"
check did u put this code in client_main[29:433] Script system initialization complete.
[29:539] Loading language packs...
[32:205] Loading language packs complete, loaded<2> packs.
[32:252] Reload client scripts...
[35:691] Script message: client_main : Error : Unexpected end of file : 14975, 1.
[35:769] Script message: client_main : Info : While parsing statement block : 12706, 1.
[35:857] Script::LoadScript - Unable to Build module<client_main>, result<-1>.
[35:910] FOServer::ReloadClientScripts - Unable to load client script<client_main>.
[38:278] Reload client scripts complete.
[38:417] AI manager initialization...
[38:510] Find bags...
[38:797] Loaded<156> bags.
[38:844] AI manager initialization complete.
[35:691] Script message: client_main : Error : Unexpected end of file : 14975, 1.
[35:769] Script message: client_main : Info : While parsing statement block : 12706, 1.
...
bool start()
{
...
Init_GUI_OnHead();
...
}
...
void render_iface( uint layer )
{
...
if( layer == 3 )
{
...
Draw_GUI_OnHead();
...
}
...
}
...
bool key_down( uint8 key )
{
...
if(key == DIK_F6)
{
Change_GUI_OnHead();
return true;
}
if(key == DIK_F7)
{
ShowNPC_GUI_OnHead();
return true;
}
...
}
...