Skip to content

Commit

Permalink
s4: add token hashes & builtins (#225)
Browse files Browse the repository at this point in the history
Co-authored-by: xensik <[email protected]>
  • Loading branch information
ProjectHiNAtyu and xensik authored Nov 1, 2024
1 parent 2b5e8f0 commit acd865b
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/xsk/gsc/engine/s4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace xsk::gsc::s4
{

constexpr usize code_count = 190;
constexpr usize func_count = 4;
constexpr usize meth_count = 0;
constexpr usize token_count = 0;
constexpr usize func_count = 54;
constexpr usize meth_count = 37;
constexpr usize token_count = 4;
constexpr u32 max_string_id = 0x110F3;

class context : public gsc::context
Expand Down
50 changes: 50 additions & 0 deletions src/gsc/engine/s4_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,60 @@ namespace xsk::gsc::s4

extern std::array<std::pair<u16, char const*>, func_count> const func_list
{{
{ 0x001, "abs" },
{ 0x005, "addbot" },
{ 0x00E, "anglestoforward" },
{ 0x010, "anglestoup" },
{ 0x01B, "bbPrint" },
{ 0x040, "clamp" },
{ 0x058, "distance2d" },
{ 0x059, "distance2dsquared" },
{ 0x068, "floor" },
{ 0x08F, "getdvar" },
{ 0x090, "getdvarfloat" },
{ 0x091, "getdvarint" },
{ 0x097, "getentarray" },
{ 0x09B, "getfirstarraykey" },
{ 0x0AD, "getmatchrulesdata" },
{ 0x0B1, "getnextarraykey" },
{ 0x0C9, "getscriptablearray" },
{ 0x0DD, "gettime" },
{ 0x0FE, "int" },
{ 0x105, "isai" },
{ 0x108, "isbot" },
{ 0x118, "isplayer" },
{ 0x122, "issubstr" },
{ 0x126, "isusingmatchrulesdata" },
{ 0x13B, "loadfx" },
{ 0x146, "map_restart" },
{ 0x15A, "obituary" },
{ 0x191, "objective_setpingsforteam" },
{ 0x19C, "playfxontag" },
{ 0x1BB, "randomfloat" },
{ 0x1BD, "randomint" },
{ 0x1D3, "setclientnamemode" },
{ 0x1D5, "setdvar" },
{ 0x1D6, "setdvarifuninitialized" },
{ 0x1D7, "setdynamicdvar" },
{ 0x1D8, "setgameendtime" },
{ 0x1DD, "setmapcenter" },
{ 0x1E9, "setomnvar" },
{ 0x20A, "spawn" },
{ 0x214, "spawnstruct" },
{ 0x215, "spawnturret" },
{ 0x248, "tolower" },
{ 0x26D, "weaponburstcount" },
{ 0x26E, "weaponclass" },
{ 0x270, "weaponclipsize" },
{ 0x272, "weaponfiretime" },
{ 0x277, "weaponisauto" },
{ 0x27A, "weaponissemiauto" },
{ 0x2BA, "isbotmatchmakingenabled" },
{ 0x2BB, "addmpbottoteam" },
{ 0x2F1, "weaponisbeam" },
{ 0x351, "makeweapon" },
{ 0x374, "isnullweapon" },
{ 0x424, "brmatchstarted" },
}};

} // namespace xsk::gsc::s4
39 changes: 39 additions & 0 deletions src/gsc/engine/s4_meth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,45 @@ namespace xsk::gsc::s4

extern std::array<std::pair<u16, char const*>, meth_count> const meth_list
{{
// { 0x80AD, "disableplayeruse" },
// { 0x8276, "enableplayeruse" },
{ 0x809B, "delete" },
{ 0x80AD, "hudoutlinedisableforclient" },
{ 0x8126, "getcurrentweapon" },
{ 0x817B, "gettagorigin" },
{ 0x817E, "tagexists" },
{ 0x81A5, "hide" },
{ 0x81B8, "iprintlnbold" },
{ 0x820C, "linkto" },
{ 0x8226, "makeunusable" },
{ 0x8227, "makeuseable" },
{ 0x8276, "playlocalsound" },
{ 0x8277, "playloopsound" },
{ 0x8291, "controlturreton" },
{ 0x82F7, "setclientomnvar" },
{ 0x8306, "setcursorhint" },
{ 0x830A, "setdefaultdroppitch" },
{ 0x832C, "sethintstring" },
{ 0x8351, "setmodel" },
{ 0x8358, "setnodeploy" },
{ 0x83C4, "show" },
{ 0x83C9, "showpart" },
{ 0x83CB, "showtoplayer" },
{ 0x83F1, "stoploopsound" },
{ 0x8401, "switchtoweaponimmediate" },
{ 0x841F, "usebuttonpressed" },
{ 0x8428, "usinggamepad" },
{ 0x84A9, "setplayermusicstate" },
{ 0x84B2, "allowmounttop" },
{ 0x84B3, "allowmountside" },
{ 0x84C7, "sethudtutorialmessage" },
{ 0x84C8, "clearhudtutorialmessage" },
{ 0x84CF, "setuserange" },
{ 0x84D0, "setuseholdduration" },
{ 0x84D5, "setusefov" },
{ 0x84D6, "sethintdisplayfov" },
{ 0x8580, "sethintrequiresholding" },
{ 0x85A4, "setasgametypeobjective" },
}};

} // namespace xsk::gsc::s4
6 changes: 5 additions & 1 deletion src/gsc/engine/s4_token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ namespace xsk::gsc::s4
{

extern std::array<std::pair<u32, char const*>, token_count> const token_list
{{
{{
{ 0x07A4, "scripts/engine/utility" },
{ 0x2AA9, "br_quests_enabled" },
{ 0x2AAA, "br_queststashlocations" },
{ 0x6D9A, "getstructarray" },
}};

} // namespace xsk::gsc::s4

0 comments on commit acd865b

Please sign in to comment.