dk22pac / plugin-sdk Goto Github PK
View Code? Open in Web Editor NEWAn SDK for developing ASI/CLEO plugins for GTA San Andreas, GTA Vice City and GTA III
License: zlib License
An SDK for developing ASI/CLEO plugins for GTA San Andreas, GTA Vice City and GTA III
License: zlib License
I'm seeing recent changes in CVector and CPathFind !
I use those classes a lot :
==========================================
CVector could have dot product as well : (vec1.x * vec2.x + vec1.y * vec2.y + vec1.z * vec2.z)
==========================================
Some extensions I needed for CPathFind (it would be good to have them in original class) :
obs.: some node address I put as Integer (ugly but made my life easier). Having automatic conversion (via operator) would be great.
void CPathFind_Ext::loadSceneForPathNodes(float X, float Y, float Z)
{
((void(__thiscall *)(CPathFind *, float, float, float)) 0x44DE00)((CPathFind *)0x96F050, X, Y, Z);
}
char CPathFind_Ext::isAreaNodesAvailable(int AreaID)
{
return ((char(__thiscall *)(CPathFind *, int)) 0x420AA0)((CPathFind *)0x96F050, AreaID);
}
CPathNode * CPathFind_Ext::getPathNode(int nodeAddr)
{
return ((CPathNode *(__thiscall *)(CPathFind *, int)) 0x420AC0)((CPathFind *)0x96F050, nodeAddr);
}
int CPathFind_Ext::findRegionForCoors (float x, float y)
{
return ((int(__thiscall *)(CPathFind *, float, float)) 0x44D830)((CPathFind *)0x96F050, x, y);
}
int CPathFind_Ext::findNodeClosestInRegion(int * outNodeInfo, int region, CVector pos, int nodeType, float * pDistance, char flag1, char flag2, char bBoatsOnly, int a11)
{
return ((int(__thiscall *)(CPathFind *, int *, int , CVector , int , float *, char , char , char , int )) 0x44F2C0)((CPathFind *)0x96F050, outNodeInfo, region, pos, nodeType, pDistance, flag1, flag2, bBoatsOnly, a11);
}
float CPathFind_Ext::findNodeOrientationForCarPlacement(int nodeAddr)
{
return ((float(__thiscall *)(CPathFind *, int)) 0x450320)((CPathFind *)0x96F050, nodeAddr);
}
float CPathFind_Ext::findNodeCoorsForScript(CVector *Coors, int node1, int node2, float *heading, BYTE *direction)
{
return ((float(__thiscall *)(CPathFind *, CVector *, int, int, float *, BYTE *)) 0x450780)((CPathFind *)0x96F050, Coors, node1, node2, heading, direction);
}
float CPathFind_Ext::these2NodesAreAdjacent(int nodeA, int nodeB)
{
return ((char(__thiscall *)(CPathFind *, int, int)) 0x44D230)((CPathFind *)0x96F050, nodeA, nodeB);
}
char CPathFind_Ext::ThisNodeWillLeadIntoADeadEnd(CPathNode * pNode_1, CPathNode * pNode_2)
{
return ((char(__thiscall *)(CPathFind *, CPathNode*, CPathNode*)) 0x44D310)((CPathFind *)0x96F050, pNode_1, pNode_2);
}
==========================================
I created something using RwIm2DRenderPrimitive
, similar to what the GPS example does, but some people report that they don't see the lines.
Everyone that said it's not working is using integrated graphics (intel HD xxx), so I suppose some that might be the cause (same for me, I can't see them when I run SA using integrated graphics on my win8 laptop).
I'm mostly clueless about how to fix this, are there alternative ways to render primitives? Or can they do something to make it work for them (updating drivers etc)?
This involves using Microsoft copyrighted headers, this doesn't look OK on redistributing those.
If the user wants to use D3D9 Headers, let him take care of it, besides, the necessary headers for complete RW header comes with most compilers.
So, my suggestion is to remove those headers from the project and assume they're installed on the target machine (as they probably are). There's also a define there to use or not to use D3D9 headers, you see, really, remove those goddamn Microsoft headers!
Could you share the tool you used for exporting the functions? I'd like to push missing functions for GTA3 to the repo.
As you can see here in this image https://cdn.discordapp.com/attachments/357966518463496192/359408325143822337/image.png
The Version is 2010 Professional
We want to keep this repository as lightweight as possible so tools should be moved to this other repo. Or we could just host the source code to the tools there; it depends.
https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_III/extensions/ScriptCommands.h#L75
V512 A call of the 'strcpy' function will lead to overflow of the buffer 'script.m_szName'. scriptcommands.h 75
Как я могу удалить plugin-sdk?
How can i remove plugin-sdk?
Delete
I create a VC ASI project after i install it on VS 2017, then it throw a alter "异常来自 HRESULT: 0x80041FE2" (means "Exception from HRESULT: 0x80041FE2")
In order to not to brake Windows command-line limit
Should we move to the new compiler/toolset?
Also what about the state of the three "tags" of plugin-sdk? Two are owned by LINK/2012, one of is DK22Pac. LINK's date to 2014. Can we clean up?
As in title, is there something like that? ( for vc )
Also what are eMoveState params?
I want for example, get the closest ped near me, if there exist, then kills the ped
Some earlier version had a wrapper (SCMWrapper) for opcodes (developed by fastman92), but now the API is missing:
https://github.com/DK22Pac/plugin-sdk/blob/master/src/sdk/plugin/script/wrapper.h
This API is important for because I already have a lot of custom code that depend on it.
(Some background: http://gtaforums.com/topic/838490-cleo-plugin-how-to-call-an-opcode-within-a-cleo-plugin/?p=1068513051)
I have created a new Vice City .Asi project, and I Press F5 to build this new project, then VS throw a error
LNK1181 cannot open input file 'plugin_vc.lib' Project2 c:\Users\XXX\documents\visual studio 2015\Projects\Project2\Project2\LINK 1
build configurations is rel
Hi!
Any example for using DDS with alpha channel?
I have a DDS-file with alpha information:
RwD3D9DDSTextureRead(PLUGIN_PATH("logo"), PLUGIN_PATH("logo"));
I have also tried to create a black/white dds file, for alpha:
RwD3D9DDSTextureRead(PLUGIN_PATH("logo"), PLUGIN_PATH("logo_alpha"));
Thanks for help.
While i try to build the paths a error pops up on codeblocks.In vs it works fine but only on cb.
here is a shot https://imgur.com/a/FwF51
`#include "plugin_vc.h"
#include "game_vc/CDraw.h"
#include "game_vc/CWeapon.h"
#include "game_vc/CPed.h"
#include "game_vc/CPlayerPed.h"
#include "game_vc/eWeaponType.h"
using namespace plugin;
class MyPlugin {
public:
MyPlugin() {
MessageBeep(true);
if (KeyPressed(VK_F9))
{
MessageBeep(true);
MessageBoxA(NULL, "LOL", "LOL", 0);
CPlayerPed twojstary;
twojstary.m_fArmour = 125.0;
twojstary.GiveWeapon(WEAPONTYPE_M4, 9999, false);
twojstary.GiveWeapon(WEAPONTYPE_MP5, 9999, false);
MessageBeep(true);
}
}
} myPlugin;`
No errors during compile, i get beep when plugin gets loaded, i press F9, nothing happens. Why ?
Edit: ok fixed, forgot processgame event, but now the player doesnt get armour and weapons, why?
Error C3861 'SetAlignment': identifier not found
Error (active) E0135 class "CFont" has no member "SetAlignment"
Error (active) E0135 class "CFont" has no member "SetProp"
Error C2039 'SetAlignment': is not a member of 'CFont'
Error C2039 'SetProp': is not a member of 'CFont'
Error C3861 'SetProp': identifier not found GPS
Possible Fix (main.cpp):
CFont::SetAlignment(ALIGN_CENTER); -> CFont::SetOrientation(ALIGN_CENTER);
CFont::SetProp(true); -> CFont::SetProportional(true);
After:
Error LNK1181 cannot open input file 'plugin.lib'
i searched in all headers that for "Peds" in general and didnt find that one that exists in SA
I'm going to update template generator for projects, and seriously thought about the possibility of using environment variables.
Should we use them for plugin-sdk projects? They can be used to determine the location of
directories.
It'll make it possible to use and compile plugin-sdk projects on different computers without any problems, without additional configuration of paths in project options.
What do you think?
How to resolve this is not written in the documentation.
It just happens that the plugin_d.lib
file is just written in the project linker config as is (without a complete path).
okay so here is code i made and need help with
https://pastebin.com/RjwsmPEN
Im trying to do something 'alike' aimassist , but i cant aim the gun correctly at the nearest ped. The game sometimes even crashes
https://www.youtube.com/watch?v=7iXgxrbE7E0
Here you see how it looks weirdly
Could you help me out fixing the code? ;/
Also i have to tap the rightclick to shoot again ;/
Is plugin-sdk compatible with fastman92limitadjuster (FLA)? FLA is a necessary plugin for projects like SAxVCxLC and Gta Underground.
I belive that some addresses in plugin-sdk need to be switchable depending on wheather FLA is running or not (and perhaps depending on which limit hacks are active). Fastman92 wrote a guideline for this: http://gtaforums.com/topic/733982-fastman92-limit-adjuster/?p=1066099922
Itis currently documented as being modelIndex but I suspect it should be pedType.
I hooked the constructor and I saw it being called with an even distribution of 4's and 5's and a lesser amount of 6's. That corresponds to Civmale, Civfemale and Cop respectively. They were definitely not the modelIndex's of the peds being spawned.
(I don't know if these files are auto-generated from another source, so I opened this issue first.
If it's okay to just send a PR I will.)
How to make my visual studio show the menu to create a .asi? The README has no useful information.
If there's a issue, is that we need some documentation.
Doxygen is a good alternative for documenting libraries, we just need to make sure the methods, members, variables, etc, are properly documented with Doxygen style comments.
Then we just need to run Doxygen and done, we have a documentation.
Yeah, the hard part is documenting the already existing code... so make sure any new code has proper documentation.
I was writing a HelpMessage and while building got that error 😢
Code : https://hastebin.com/unifiriviw.cpp
Full Image: https://cdn.discordapp.com/attachments/334256187530936320/355745457332420608/unknown.png
plugin-sdk/plugin_sa/game_sa/CPool.h
Line 68 in 8dd5292
This should be false! Apparently my own issue from years back :(
EDIT:
Also shouldn't allocate memory by itself but rather just assign the ones passed to the function - hence they don't "take ownership" of these allocations.
Hello.
Have plugin-sdk a functionality to call SCM functions?
I have a repo which is broken now, but I collected a lot of useful addresses and SCM-functions you probably can include into plugin-sdk. It based on SCMMod by Spookie (you can Google it on Game Forums). Project developed only for VC.
I can contribute to a project and extend it when I understand how to use a plugin-sdk.
Привет.
Имеет ли plugin-sdk функционал для работы с функциями SCM?
У меня есть репозиторий, который давно забросил, но собрал в нём массу полезных адресов и SCM-функций, которые вы могли бы себе забрать.
Он основана на SCMMod от Spookie (его можно найти его на игровых форумах). Проект разработан только для VC.
Я могу присоединиться к проекту и расширить его, когда пойму, как им пользоваться.
Link/Ссылка: https://github.com/Serabass/vc-magic
This commit has added compilation units to the plugin_sa project that appear to be missing from the repository:
ScriptCommands.cpp
ScriptCommands.h
game_sa/CRunningScriptWrapper.cpp
game_sa/CRunningScriptWrapper.h
Compilation fails. I recommend to take care of this issue accordingly, the guy who made that commit basically. Like, are those files supposed to be still inside plugin-sdk? Seems like pretty temporary stuff to me.
Thanks.
According to https://go.microsoft.com/fwlink/?linkid=2023588:
The version of Visual C++ in Visual Studio 2019 preview 0 and later does not include support for creating code for Windows XP by using the v142 toolset.
SDK requires building with v141_xp toolset, so i think we cannot build plugins in 2019 version?
Может кто обновить GPS в asi. пытался скомпилировать, только вот не работает он?
As in title. I get that error
Hi!
The original Reset event looks like this:
IDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS *pPresentationParameters)
Is there a way to add that parameter to d3dResetEvent?
void DResetEvent(D3DPRESENT_PARAMETERS *pPresentationParameters){}
Events::d3dResetEvent.Add(DResetEvent);
UPDATE: Doesn't happen now, it's solved.
When I was installing plugin sdk, I noticed when clicking Visual Studio 2019 even with administrator rights did not install the template, multiple times I tried it. So I went ahead into the tools folder, and got the PluginSdkVsTools.vsix file and manually tried to install it by dragging on the VsixInstaller.exe, it threw this log and error:
02/06/2019 6:13:23 AM - Microsoft VSIX Installer
02/06/2019 6:13:23 AM - -------------------------------------------
02/06/2019 6:13:23 AM - vsixinstaller.exe version:
02/06/2019 6:13:23 AM - 16.1.3128
02/06/2019 6:13:23 AM - -------------------------------------------
02/06/2019 6:13:23 AM - Command line parameters:
02/06/2019 6:13:23 AM - C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VSIXInstaller.exe,C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VsixInstallerEe.vsix
02/06/2019 6:13:23 AM - -------------------------------------------
02/06/2019 6:13:23 AM - Microsoft VSIX Installer
02/06/2019 6:13:23 AM - -------------------------------------------
02/06/2019 6:13:23 AM - Initializing Install...
02/06/2019 6:13:24 AM - Extension Details...
02/06/2019 6:13:24 AM - Identifier : PluginSdkVSTools.ae8caae3-b338-4fb4-9a8c-505425687c53
02/06/2019 6:13:24 AM - Name : Plugin-SDK Visual Studio Tools
02/06/2019 6:13:24 AM - Author : Plugin-SDK
02/06/2019 6:13:24 AM - Version : 0.7.3.0
02/06/2019 6:13:24 AM - Description : Plugin-SDK Visual Studio Tools for creating plugins (ASI/CLEO/MoonLoader) for Grand Theft Auto.
02/06/2019 6:13:24 AM - Locale : en-US
02/06/2019 6:13:24 AM - MoreInfoURL : https://github.com/DK22Pac/plugin-sdk
02/06/2019 6:13:24 AM - InstalledByMSI : False
02/06/2019 6:13:24 AM - SupportedFrameworkVersionRange : [4.5,)
02/06/2019 6:13:24 AM -
02/06/2019 6:13:24 AM - SignatureState : Unsigned
02/06/2019 6:13:24 AM - Supported Products :
02/06/2019 6:13:24 AM - Microsoft.VisualStudio.Community
02/06/2019 6:13:24 AM - Version : [14.0,17.0)
02/06/2019 6:13:24 AM -
02/06/2019 6:13:24 AM - References :
02/06/2019 6:13:24 AM - Prerequisites :
02/06/2019 6:13:24 AM - -------------------------------------------------------
02/06/2019 6:13:24 AM - Identifier : Microsoft.VisualStudio.Component.CoreEditor
02/06/2019 6:13:24 AM - Name : Visual Studio core editor
02/06/2019 6:13:24 AM - Version : [15.0,)
02/06/2019 6:13:24 AM -
02/06/2019 6:13:24 AM - Signature Details...
02/06/2019 6:13:24 AM - Extension is not signed.
02/06/2019 6:13:24 AM -
02/06/2019 6:13:24 AM - Searching for applicable products...
02/06/2019 6:13:24 AM - Found installed product - Global Location
02/06/2019 6:13:24 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable1& skuData) at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported) at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported) at VSIXInstaller.App.Initialize(Boolean isRepairSupported) at VSIXInstaller.App.Initialize() at System.Threading.Tasks.Task
1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
I tried copying project settings for each game into a single project with different build settings corresponding to each game (III, VC, SA). No luck because Visual Studio can't find the include files. How can I be able to accomplish this?
Before the git update I said that there was an error wich I did fix by myself but after that this appeared:
Error LNK1181 cannot open input file 'plugin.lib'
After today's update it still give me that error (with an additional line):
Severity Code Description Project File Line Suppression State Error MSB6006 "link.exe" exited with code 1181. GPS C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 676 Error LNK1181 cannot open input file 'plugin.lib' GPS C:\Users\ArminC\Desktop\plugin-sdk-master\examples\GPS\LINK 1
Hi. I'm trying to compile a simple script but it gives me this error:
error: 'auto' parameter not permitted in this context
The problem is in line 33 of PluginBase.h. It says template<auto Func>
is incorrect. My compiler is GNU GCC compiler. Is there any solution for that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.