Raised This Month: $12 Target: $400
 3% 

[EXTENSION][CS:GO] VScript Functions


Post New Thread Reply   
 
Thread Tools Display Modes
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 03-12-2018 , 17:23   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #11

Hi,
small update - I've added a SM interface:
https://github.com/jonatan1024/vscri...iptfunctions.h
Now this extension can be easily used by other extensions direcly from c++.

Example usage, getting current map name.
Code:
ScriptVariant_t mapName = g_pVSF->CallFunction("", "GetMapName", NULL, NULL);
The map name string can be retrieved from returned ScriptVariant_t either from its member m_pszString or by casting it to const char *.

This is the case of a "global" function, in case of member function, you supply the class name into the first parameter and the object pointer into the third parameter. If the function require parameters, you pass an array of ScriptVariant_t into the last parameter.

The g_pVSF interface pointer was acquired using the method described here:
https://wiki.alliedmods.net/Writing_...nal_Interfaces
__________________
Sorry for my english.
Backup is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 04-08-2018 , 16:32   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #12

I think you attached the wrong binaries for the newest release. sm exts reports 1.0.0.1 even though I downloaded 1.0.1.0.
__________________
retired
shavit is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 04-09-2018 , 02:40   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #13

PHP Code:
[SMPlugin test.smx failed to loadNative "VSF_CBaseAnimating.LookupAttachment" was not found
"VSF_CBaseAnimating.LookupAttachment" is present in the generated file data/vscriptfun/natives. tested on windows.
kossolax is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 04-09-2018 , 07:25   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #14

Quote:
Originally Posted by shavit View Post
I think you attached the wrong binaries for the newest release. sm exts reports 1.0.0.1 even though I downloaded 1.0.1.0.
Thanks, uploaded the correct binaries.

Quote:
Originally Posted by kossolax View Post
PHP Code:
[SMPlugin test.smx failed to loadNative "VSF_CBaseAnimating.LookupAttachment" was not found
"VSF_CBaseAnimating.LookupAttachment" is present in the generated file data/vscriptfun/natives. tested on windows.
Please check wheter the module loads correctly (sm exts).
__________________
Sorry for my english.
Backup is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 04-09-2018 , 07:31   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #15

sm exts load vscriptfun
[SM] Loaded extension vscriptfun.ext.dll successfully.

sm exts list
[10] VScript Functions (1.0.0.1): Exposes VScript methods to SourceMod

PHP Code:
 SourceMod Version Information:
    
SourceMod Version1.8.0.6041
    SourcePawn Engine
SourcePawn 1.8jit-x86 (build 1.8.0.6041)
    
SourcePawn APIv1 4v2 11 
kossolax is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 04-09-2018 , 08:14   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #16

Quote:
Originally Posted by kossolax View Post
[10] VScript Functions (1.0.0.1): Exposes VScript methods to SourceMod
Quote:
Originally Posted by Backup View Post
Thanks, uploaded the correct binaries.
You should re-update it.
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 04-09-2018 , 08:35   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #17

Oh, you are right, thanks! I didn't notice the files was already update on github.
kossolax is offline
Yuuhisaka
New Member
Join Date: Aug 2013
Old 05-03-2018 , 06:26   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #18

I can't compile your sample script.

The compiler showed the following:

Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// aaa.sp
//
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(25) : error 177: static method 'GetVelocity' must be invoked via its type (try 'VSF_CBaseEntity.GetVelocity')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(29) : error 177: static method 'SetVelocity' must be invoked via its type (try 'VSF_CBaseEntity.SetVelocity')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(31) : error 177: static method 'SetHealth' must be invoked via its type (try 'VSF_CBaseEntity.SetHealth')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(35) : error 177: static method 'PrecacheScriptSound' must be invoked via its type (try 'VSF_CBaseEntity.PrecacheScriptSound')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(36) : error 177: static method 'EmitSound' must be invoked via its type (try 'VSF_CBaseEntity.EmitSound')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(22) : warning 204: symbol is assigned a value that is never used: "player"
//
// 5 Errors.
//
// Compilation Time: 1.75 sec
// ----------------------------------------

Press enter to exit ...

Last edited by Yuuhisaka; 05-03-2018 at 06:36.
Yuuhisaka is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 05-03-2018 , 13:43   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #19

Quote:
Originally Posted by Yuuhisaka View Post
I can't compile your sample script.

The compiler showed the following:

Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// aaa.sp
//
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(25) : error 177: static method 'GetVelocity' must be invoked via its type (try 'VSF_CBaseEntity.GetVelocity')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(29) : error 177: static method 'SetVelocity' must be invoked via its type (try 'VSF_CBaseEntity.SetVelocity')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(31) : error 177: static method 'SetHealth' must be invoked via its type (try 'VSF_CBaseEntity.SetHealth')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(35) : error 177: static method 'PrecacheScriptSound' must be invoked via its type (try 'VSF_CBaseEntity.PrecacheScriptSound')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(36) : error 177: static method 'EmitSound' must be invoked via its type (try 'VSF_CBaseEntity.EmitSound')
// F:\FPSGAME\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\addons\sourcemod\scripting\aaa.sp(22) : warning 204: symbol is assigned a value that is never used: "player"
//
// 5 Errors.
//
// Compilation Time: 1.75 sec
// ----------------------------------------

Press enter to exit ...
Read the errors and replace the methods with the corrections.
ThatKidWhoGames is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 05-03-2018 , 13:47   Re: [EXTENSION][CS:GO] VScript Functions
Reply With Quote #20

Quote:
Originally Posted by Yuuhisaka View Post
I can't compile your sample script.

The compiler showed the following:
...
Could you please attach the generated file "include/vscriptfun.inc"?
Quote:
Originally Posted by ThatKidWhoGames View Post
Read the errors and replace the methods with the corrections.
Well the methods are obviously not static, the code should work just fine without any modifications.
__________________
Sorry for my english.
Backup is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode