IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

This section is for obtaining help on creating and releasing tools

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (2) [1] 2   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [WIP|REL] San Andreas .NET Script Hook

 Code SA scripts without the fuzz of CLEO
 
NTAuthority  
Posted: Monday, Mar 9 2009, 12:14
Quote Post


member_title
Group Icon
Group: Members
Joined: Sep 9, 2008

eu.gif

Member Award




What is this mod?

This modification is, like other script hooks, adds a external scripting possibility to SA. I know CLEO already exists, but SA's SCM language has some major limitations -- so I wrote this .NET scripting hook. It is inspired by HazardX's IV scripting hook, and based on the existing C++ SA script hook.

This version is a pretty tiny initial testing version, with just a few APIs (and a CallOpcode function smile.gif )

How to use this mod?

Just copy the scripts directory and the .asi file to your SA directory. The .NET Framework 3.5, and the Visual C++ 2008 Runtime are required. For development I recommend using Visual Studio/Visual C# Express's IntelliSense feature, example scripts for C# are in the scripts/development/ directory.

The hook will read both compiled .dll files, and .cs/.vb files, though Visual Basic is untested. To open or close the console, just press `.

TestScript2.cs has a keybinding of 'U': spawn a Ballas member and add some health to the player.
RandomStuff.cs has more key bindings:

- 'I': display a text box
- 'O': Spawn a Vagos member.
- 'kill' in console: Kill the player.
- 'spawn groves' in console: spawn 3 GSF members around the player

Where to download?

Version 0.0.3

You will need at least the DirectX November 2008 runtimes to use the script hook!

I look forward to your comments. smile.gif

This post has been edited by NTAuthority on Thursday, Apr 16 2009, 19:40
PMMSNXbox LivePlayStation Network
  Top
 

 
Wesser  
Posted: Monday, Mar 9 2009, 13:16
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




Really interesting, but it seems that there aren't any references, or am I wrong?
PMMSNPlayStation Network
  Top
 

 
NTAuthority  
Posted: Monday, Mar 9 2009, 13:27
Quote Post


member_title
Group Icon
Group: Members
Joined: Sep 9, 2008

eu.gif

Member Award




QUOTE (Wesser @ Mar 9 2009, 14:16)
Really interesting, but it seems that there aren't any references, or am I wrong?

You can simply add the .asi file as reference in Visual Studio if you copy it to a .dll -- didn't know VS would give errors if it's not a .dll file, will fix it in the next version. smile.gif
PMMSNXbox LivePlayStation Network
  Top
 

 
Grove Street Boy  
Posted: Monday, Mar 9 2009, 15:30
Quote Post


Maggot for life!
Group Icon
Group: Members
Joined: Aug 6, 2005

mars.gif

XXXXX



cool! but this means i have to learn C++ to code for this hook? I only know Java, VB.Net and Cleo confused.gif
PM
  Top
 

 
NTAuthority  
Posted: Monday, Mar 9 2009, 15:32
Quote Post


member_title
Group Icon
Group: Members
Joined: Sep 9, 2008

eu.gif

Member Award




QUOTE (Grove Street Boy @ Mar 9 2009, 16:30)
cool! but this means i have to learn C++ to code for this hook? I only know Java, VB.Net and Cleo confused.gif

Nope, you can't even use C++ 'officially' biggrin.gif The examples are just C#, but I have also written in support for VB.NET scripts, though you will need to discover the syntax yourself. By the way, C# is almost Java syntax with VB.NET's class libraries. smile.gif Next up for this hook: car APIs, and some more character stuff.

EDIT: ported RandomStuff.cs to VB.NET:

CODE

Imports System
Imports System.Collections.Generic
Imports System.Text

Namespace TestScript1
   Public Class TestScript
       Inherits GTA.Script

       Public Sub TestScript()
           BindKey(System.Windows.Forms.Keys.O, New GTA.KeyPressDelegate(AddressOf SpawnVago))
           BindKey(System.Windows.Forms.Keys.I, New GTA.KeyPressDelegate(AddressOf ShowText))
           BindConsoleCommand("kill", New GTA.ConsoleCommandDelegate(AddressOf Kill), Me)
           BindConsoleCommand("spawn groves", New GTA.ConsoleCommandDelegate(AddressOf NewGroves), Me)
       End Sub

       Public Sub Kill(ByVal args As String())
           PlayerObject.Character.Health = 0

           GTA.Console.WriteLine("Killed the player!")
       End Sub

       Public Sub NewGroves(ByVal args As String())
           Dim ped As GTA.Char = GTA.World.CreateChar(GTA.PedID.FAM1, PlayerObject.Character.Position.Around(2), 4)
           ped = GTA.World.CreateChar(GTA.PedID.FAM2, PlayerObject.Character.Position.Around(2), 4)
           ped = GTA.World.CreateChar(GTA.PedID.FAM3, PlayerObject.Character.Position.Around(2), 4)
       End Sub

       Public Sub SpawnVago()
           Dim vector As GTA.Vector3 = PlayerObject.Character.Position

           vector.pY += 1
           Dim ped As GTA.Char = GTA.World.CreateChar(GTA.PedID.LSV2, vector, 4)
       End Sub

       Public Sub ShowText()
           GTA.Game.DisplayTextBox("You pressed I")
       End Sub
   End Class
End Namespace


This post has been edited by NTAuthority on Monday, Mar 9 2009, 15:53
PMMSNXbox LivePlayStation Network
  Top
 

 
Zach  
Posted: Tuesday, Mar 10 2009, 03:36
Quote Post


Thug
Group Icon
Group: Members
Joined: Jun 29, 2004

us.gif

XXXXX



Nice. Any chance you'll release the source code (for your hook) as well?
PM
  Top
 

 
Grove Street Boy  
Posted: Tuesday, Mar 10 2009, 10:16
Quote Post


Maggot for life!
Group Icon
Group: Members
Joined: Aug 6, 2005

mars.gif

XXXXX



lol cool. Ive been learning VB.NET in college lately! Really should look into learning this tool. smile.gif
PM
  Top
 

 
rlim201  
Posted: Sunday, May 17 2009, 13:55
Quote Post


Player Hater
Group Icon
Group: Members
Joined: May 17, 2009

XXXXX



download link is dead!
PM
  Top
 

 
joemomma53  
Posted: Tuesday, Jun 2 2009, 21:18
Quote Post


Ohai
Group Icon
Group: Members
Joined: Jun 10, 2007

us.gif

XXXXX



Sorry for bump, But I downloaded this and started testing it. It's really nice. The only thing I found wrong with it is that I can't get it to read .dll's, but thats not really a big deal, as it reads the C# source file biggrin.gif

By the way, is there a documentation on it, like for what it supports, like vehicle API's for example? I was also wondering if it had a weapons API in it
PM
  Top
 

 
NTAuthority  
Posted: Tuesday, Jun 9 2009, 14:32
Quote Post


member_title
Group Icon
Group: Members
Joined: Sep 9, 2008

eu.gif

Member Award




QUOTE (joemomma53 @ Jun 2 2009, 23:18)
Sorry for bump, But I downloaded this and started testing it. It's really nice. The only thing I found wrong with it is that I can't get it to read .dll's, but thats not really a big deal, as it reads the C# source file biggrin.gif

By the way, is there a documentation on it, like for what it supports, like vehicle API's for example? I was also wondering if it had a weapons API in it

(sorry for bumping, have been away from april 30th to today)

It should be able to use .dll files, if not, could you please post the log file entries? Also, the GTA.Next version of the hook supports weapon changing (but Native.CallOpcode is a good help) -- I'll update the links later this week.
PMMSNXbox LivePlayStation Network
  Top
 

 
joemomma53  
Posted: Thursday, Jun 11 2009, 01:14
Quote Post


Ohai
Group Icon
Group: Members
Joined: Jun 10, 2007

us.gif

XXXXX



QUOTE (NTAuthority @ Jun 9 2009, 14:32)
QUOTE (joemomma53 @ Jun 2 2009, 23:18)
Sorry for bump, But I downloaded this and started testing it. It's really nice. The only thing I found wrong with it is that I can't get it to read .dll's, but thats not really a big deal, as it reads the C# source file biggrin.gif

By the way, is there a documentation on it, like for what it supports, like vehicle API's for example? I was also wondering if it had a weapons API in it

(sorry for bumping, have been away from april 30th to today)

It should be able to use .dll files, if not, could you please post the log file entries? Also, the GTA.Next version of the hook supports weapon changing (but Native.CallOpcode is a good help) -- I'll update the links later this week.

Well, My second hard drive got formatted the other day and I still need to re install San Andreas. When I re install it, I will get the logs and upload them for you biggrin.gif.

Thank you for your answer, when I get every thing set back up I will be experimenting with this more.
PM
  Top
 

 
Donny78  
Posted: Thursday, Aug 20 2009, 11:39
Quote Post


Zombie
Group Icon
Group: Members
Joined: Jul 18, 2008

en.gif

XXXXX



Is this still being developed ?

Just thought I'd ask as I'm interested in this for sure.
PM
  Top
 

 
joemomma53  
Posted: Saturday, Aug 22 2009, 23:08
Quote Post


Ohai
Group Icon
Group: Members
Joined: Jun 10, 2007

us.gif

XXXXX



I don't think it is
PM
  Top
 

 
sgt.slaughter  
Posted: Sunday, Aug 23 2009, 01:30
Quote Post


Li'l G Loc
Group Icon
Group: BUSTED!
Joined: Nov 26, 2008

us.gif

XXXXX



I tried the link,it seems to get some sort of error confused.gif .I'll post the link to the GTAGaming download page just in-case someone else is getting the same thing icon14.gif :

http://www.gtagaming.com/downloads/gta-san...reas/tools/2354
PMMSNYahoo
  Top
 

 
NTAuthority  
Posted: Monday, Aug 24 2009, 10:00
Quote Post


member_title
Group Icon
Group: Members
Joined: Sep 9, 2008

eu.gif

Member Award




QUOTE (joemomma53 @ Aug 23 2009, 01:08)
I don't think it is

It is, though I haven't gotten around to releasing the new version (with HUGE updates) tounge.gif
PMMSNXbox LivePlayStation Network
  Top
 

 
Donny78  
Posted: Monday, Aug 24 2009, 13:58
Quote Post


Zombie
Group Icon
Group: Members
Joined: Jul 18, 2008

en.gif

XXXXX



QUOTE (NTAuthority @ Aug 24 2009, 10:00)
QUOTE (joemomma53 @ Aug 23 2009, 01:08)
I don't think it is

It is, though I haven't gotten around to releasing the new version (with HUGE updates) tounge.gif

Good news, thankyou.
PM
  Top
 

 
joemomma53  
Posted: Thursday, Sep 3 2009, 01:56
Quote Post


Ohai
Group Icon
Group: Members
Joined: Jun 10, 2007

us.gif

XXXXX



Yay!

I look forward to the updates biggrin.gif
PM
  Top
 

 
NTAuthority  
Posted: Saturday, Sep 5 2009, 17:36
Quote Post


member_title
Group Icon
Group: Members
Joined: Sep 9, 2008

eu.gif

Member Award




A tiny hint of one of the more special features in the next version... texture drawing. And by that, I mean with the old DX hooking code, but with a feature the IV hook doesn't have. If you know some C#, check out the code below:

CODE

this.tex = new Texture(256, 32);

// ...

Graphics rbg = this.tex.LockBitmap();
rbg.DrawString("Woef", this.font, new SolidBrush(Color.Black), 125, 0);
this.tex.UnlockBitmap();

// and... in another 'event'

Direct3D.DrawSprite(tex, new RectangleF(vPos.X, vPos.Y, GetX(105), GetY(28)), Color.White, 256f, 32f);


Indeed, the most annoying thing in the world (LockRectangle) now in a easy-to-use package for drawing your own dynamic textures. biggrin.gif

PMMSNXbox LivePlayStation Network
  Top
 

 
joemomma53  
Posted: Saturday, Sep 5 2009, 18:08
Quote Post


Ohai
Group Icon
Group: Members
Joined: Jun 10, 2007

us.gif

XXXXX



biggrin.gif

Very nice

EDIT : Oh yeah, forgot to say. Well, in C# I added SanAndreasScriptHook as a reference, and even when I have
CODE
using SanAndreasScriptHook;
I get the error :
QUOTE
The type or namespace name 'SanAndreasScriptHook' could not be found (are you missing a using directive or an assembly reference?)


I never got it before cause I never added the reference.

Any way to fix this?

This post has been edited by joemomma53 on Sunday, Sep 6 2009, 06:16
PM
  Top
 

 
NTAuthority  
Posted: Sunday, Sep 13 2009, 18:00
Quote Post


member_title
Group Icon
Group: Members
Joined: Sep 9, 2008

eu.gif

Member Award




QUOTE (joemomma53 @ Sep 5 2009, 20:08)
EDIT : Oh yeah, forgot to say. Well, in C# I added SanAndreasScriptHook as a reference, and even when I have
CODE
using SanAndreasScriptHook;
I get the error :
QUOTE
The type or namespace name 'SanAndreasScriptHook' could not be found (are you missing a using directive or an assembly reference?)


I never got it before cause I never added the reference.

Any way to fix this?

Sorry for the late response... but as you may have already figured out, the assembly name is indeed SanAndreasScriptHook, but the namespace everything's in is named GTA. By the way, the next release will have another very cool feature that allows you to 'hack' into the control state stuff... I have already made a cool gamepad control mod for the next version! I just want to release it now since it's so cool, but I can't tounge.gif
PMMSNXbox LivePlayStation Network
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (2) [1] 2 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG