Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (84,853 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

julionib

[TUT] How to create VB.Net scripts

Recommended Posts

julionib
Nevitro

Good work! Really!

I watched video with PTFX effects. Just simple online compilator to C# and some things i will try in c#! smile.gif

 

Mayby together we can make tutorials - i just will 'translate' Your mods in C#? smile.gif

Share this post


Link to post
Share on other sites
julionib
Good work! Really!

I watched video with PTFX effects. Just simple online compilator to C# and some things i will try in c#! smile.gif

 

Mayby together we can make tutorials - i just will 'translate' Your mods in C#? smile.gif

thx man, feel free to use/translate it

Share this post


Link to post
Share on other sites
AgentWD40

nice idea nevitro but I still would like to see some C# tutorials if not to much work. Shifty41s_beerhatsmilie2.gif impressive work julionib!

Edited by hardsty1e

Share this post


Link to post
Share on other sites
julionib

new video added: Get targeted ped, vehicle, object or ground

Share this post


Link to post
Share on other sites
Tori_95

COOOOOL, thanks bro biggrin.gifinlove.gifinlove.gif

Share this post


Link to post
Share on other sites
julionib

added tut about Ghost rider script and groups

Share this post


Link to post
Share on other sites
julionib

Creating rockets (and start kidding with custom class):

 

 

Share this post


Link to post
Share on other sites
D T

Thanks for these tutorials! All your scripts are very useful.

 

Is it possible to create a vb.net script that makes Niko say something with the push of a button? I know simple native trainer can do this, but I'd rather have a simple script for it instead.

Share this post


Link to post
Share on other sites
julionib
Is it possible to create a vb.net script that makes Niko say something with the push of a button? I know simple native trainer can do this, but I'd rather have a simple script for it instead.

i know that its possible to make him say game speech, with different voices too, but i tryed some exaples with no success, maybe im missing some details

Share this post


Link to post
Share on other sites
Pie015

Hey Julio, I watched your tutorials and subscribed, your a great help but I ran into some trouble with the "GetNearestPed" function. Everytime I press F10 the script has an error! FYI: The script is supposed to make the closest ped drive your car to the waypoint, originally meant for helicopter because Simple Native Trainer drivers don't support helicopters.

 

 

Imports SystemImports System.DrawingImports System.Windows.FormsImports GTAPublic Class HeliDriverScript   Inherits Script   Private myPed As Ped   Private myVeh As Vehicle   Private InVehicle As Boolean = True   Public Sub New()       Me.Interval = 10   End Sub   Private Sub HeliDriverScript_KeyUp(sender As Object, e As GTA.KeyEventArgs) Handles Me.KeyUp       If e.Key = Keys.F10 AndAlso Exists(Game.GetWaypoint) AndAlso Player.Character.isInVehicle = True Then           World.GetClosestPed(Player.Character.Position, 5.0F)           myVeh = Player.LastVehicle()           If World.GetClosestPed(Player.Character.Position, 5.0F) = Nothing Then           Else               myPed = World.GetClosestPed(Player.Character.Position, 5.0F)               If myPed.isInVehicle = True Then                   Exit Sub               End If               myPed.Task.EnterVehicle(myVeh, VehicleSeat.Driver)           End If           If myPed.isInVehicle = True Then               myPed.Task.DriveTo(Game.GetWaypoint.Position.ToGround, 200, True, True)           End If       End If   End Sub   Private Sub HeliDriverScript_Tick(sender As Object, e As EventArgs) Handles Me.Tick   End SubEnd Class

 

 

EDIT: Here is the scripthookdotnet log

 

2013-01-12 17:21:08 - Error during Tick in script 'HeliDriverScript':

System.NullReferenceException: Object reference not set to an instance of an object.

at HeliDriverScript.HeliDriverScript_KeyUp(Object sender, KeyEventArgs e)

at GTA.Script.ProcessEvents()

at GTA.Script.DoTick()

at GTA.ScriptThread.OnTick()

Edited by Pie015

Share this post


Link to post
Share on other sites
julionib

well

 

you must check if the possible detected ped exists, i did some changes and explanations that can help you:

 

 

Imports SystemImports System.DrawingImports System.Windows.FormsImports GTAPublic Class HeliDriverScript  Inherits Script  Private myPed As Ped  Private myVeh As Vehicle  Private InVehicle As Boolean = True  Public Sub New()      Me.Interval = 10  End Sub  Private Sub HeliDriverScript_KeyUp(sender As Object, e As GTA.KeyEventArgs) Handles Me.KeyUp      If e.Key = Keys.F10 AndAlso Exists(Game.GetWaypoint) AndAlso Player.Character.isInVehicle Then          myVeh = Player.lastvehicle ' get the vehicle          dim myTmpPed as ped = nothing ' lets declare an temporary ped object          myTmpPed  = World.GetClosestPed(Player.Character.Position, 20.0F) ' search for him/her          If exists(myTmpPed ) Then ' check if exists              ' then do the code related to the found ped              If myTmpPed.isInVehicle Then                  Exit Sub              End If                   ' we need to free the Driver seat     player.character.WarpIntoVehicle(myVeh, vehicleseat.RightFront)              ' just to see who its the found ped     myTmpPed.attachblip                   ' its good to clear possible previous tasks     myTmpPed.Task.clearall              ' before setting new ones              myTmpPed.Task.EnterVehicle(myVeh, VehicleSeat.Driver)              myTmpPed.Task.DriveTo(Game.GetWaypoint.Position.ToGround, 200, True, True)              ' you can call the two tasks in sequence, if im not wrong          game.displaytext("ped found") 	else   game.displaytext("ped not found")          End If      End If  End Sub  Private Sub HeliDriverScript_Tick(sender As Object, e As EventArgs) Handles Me.Tick  End SubEnd Class

 

Share this post


Link to post
Share on other sites
123iamking

 

Tip: Run gta in window mode using commandline.txt with line -windowed or with an shortcut to the LaunchGTAIV.exe with param -windowed

 

Can you upload step by step photos about this ? As usual , I write a script then put it in Scripts folder and test it . I don't know how to have GTAIV process it along with its real scripts threads (even I have downloaded GTA_IV_CPLUSPLUS_Script_Hook_Version_0.4.0_(Development_Kit)_(Apr_16_2010)_by_aru) , you know , launch the game then realize your scripts crash but you can't fix it immediately - you have to quit the game then fix the script then launch it again monocle.gif

Share this post


Link to post
Share on other sites
julionib
Tip: Run gta in window mode using commandline.txt with line -windowed or with an shortcut to the LaunchGTAIV.exe with param -windowed

 

Can you upload step by step photos about this ? As usual , I write a script then put it in Scripts folder and test it . I don't know how to have GTAIV process it along with its real scripts threads (even I have downloaded GTA_IV_CPLUSPLUS_Script_Hook_Version_0.4.0_(Development_Kit)_(Apr_16_2010)_by_aru) , you know , launch the game then realize your scripts crash but you can't fix it immediately - you have to quit the game then fix the script then launch it again monocle.gif

mmm, well to open in window mode you can create an text file called commandline.txt inside your GTAIV.exe folder, then inside this file you add the line:

 

-windowed

 

and save it, the game should open in window mode

 

for version 1.0.4.0 or bellow you need to press Win+D (windows key + D key) to minimize all, including GTA window, then you can access your editor window, for version 1.0.7.0 its good to use Alt+Tab to change between gta window and the editor window, but its good to have the game in the Map menu to avoid doing things in the game window with the keypresses in the script editor ^^

 

in version 1.0.4.0 if you come back to gta window and it dont chagne from black to the normal game window after soem seconds, you can press ctrl+alt+del to call windows "managment" menu and them press Esc to close this menu, then the gta window should be normal again smile.gif

Share this post


Link to post
Share on other sites
123iamking

Can you say more about the library we using

I often using these :

 

using System;using System.Windows.Forms;using GTA;using System.Collections.Generic;

 

but somebody often using those

 

using System;using System.Windows.Forms;using System.Drawing;using System.IO;using System.Media;using GTA;

 

so can u explain each library and what library we should use ? monocle.gif

It's kind of important cause some people can or can't use some scripts just because of the library we import monocle.gif Am I right ?

Share this post


Link to post
Share on other sites
julionib

 

so can u explain each library and what library we should use  ? monocle.gif

It's kind of important cause some people can or can't use some scripts just because of the library we import  monocle.gif  Am I right ?

no, the library will affect the development and not the execution, without the proper library you cant access some methods/properties/language objects in an easy way...

 

for example: system.windows.forms its necessary to have easy access to Keys enumeration that you probably will use in keydown events:

 

 

Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown                   if e.key = keys.d1 then

 

 

without the library system.windows.forms, you will have more work because you will need to specify the entire "path" to keys eumeration

 

 

Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown                   if e.key = system.windows.forms.keys.d1 then

 

 

 

its basically this

 

 

now, to determine what you will need or not will depend on what exactly you will do in your script

 

for example: to use File.readAllBytes (when loading image data to texture) you will need system.IO to have easy access to "File."

 

 

this System.Collections.Generic its necessary to create lists of objects

 

 

basically what i do to discover what library i will need its try to find some examples on web, not scripting examples but language examples, but in great part of cases Visual Studio tells me what library im probably missing

 

 

 

obs.: I did this explanation based on my experiences with vb.net, im not vb.net programmer, so probably something here can be wrong or with bad exaplanation ^^

Share this post


Link to post
Share on other sites
avatar0068

thanks, this is a useful post icon14.gif

Share this post


Link to post
Share on other sites
123iamking

GTA 4 has a lot of great audio files - but I don't know how to call it .

If I want to trigger the sound : "THUNDER_CLOSE" (I found this in the file sound.dat15) - How can I do it ?

Thanks for reading . colgate.gif

Share this post


Link to post
Share on other sites
julionib
GTA 4 has a lot of great audio files - but I don't know how to call it .

If I want to trigger the sound : "THUNDER_CLOSE" (I found this in the file sound.dat15) - How can I do it ?

Thanks for reading . colgate.gif

seems that you didn't saw this tutorial in first page smile.gif

 

http://gtaxscripting.blogspot.com.br/2013/...d-external.html

 

i show how to play game sounds and i provide an "sounds demo" script to help you filter and hear the sounds ingame.

Share this post


Link to post
Share on other sites
123iamking

Is there any way to make the blood or rain drop appears on the camera ?

Just like when you get hit - the camera is automatically covered with blood (a lot of blood)

when it's rain - the camera is automatically covered with water (a lot of water)

the basic R* blood and rain drop camera effect's not satisfied at all

PS : use native function to run animation

 

GTA.Native.Function.Call("TASK_PLAY_ANIM", Player.Character, "walking_shove_l_", "missjacob2", 4.00, 0, 1, 1, 0, -2);

 

OR use

 

Player.Character.Task.PlayAnimation(new AnimationSet("missjacob2"), "piss_loop", 1.0f);  

 

(sorry ,I use C# script )

would be better ?

Edited by 123iamking

Share this post


Link to post
Share on other sites
julionib

i will try to create this blood effect for my chainsaw script

 

i dont know what is better, to use animation flags i prefer to use scripthook object task, to simple play i use native method

Share this post


Link to post
Share on other sites
123iamking

I think you pasted the wrong code of the Sound Demo Script .

When I open console and press "sd" , nothing happen , then I read the script , I see this

 

....If e.Key = Keys.NumPad0 Then           For Each o As GTA.Object In World.GetAllObjects               If Exists(o) AndAlso (o.Position.DistanceTo(Player.Character.Position) < 5) Then                   Native.Function.Call("PLAY_SOUND_FROM_OBJECT", soundID, "GENERAL_WEAPONS_ROCKET_LOOP", o).....

 

Please check again and post the right code , Thank for your tut , It's cool cookie.gifcookie.gif

Share this post


Link to post
Share on other sites
Nevitro

Julio, You should add instruction how add screen effect tutorial smile.gif

Share this post


Link to post
Share on other sites
123iamking

A mod would not be completed if u miss "Animation" smile.gif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.