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

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

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: (146) 1 [2] 3 4 ... Last »  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [BETA] GTAIV .Net ScriptHook

 V1.6.1.1 Released 1.0.6.0 / EFLC Support
 
KewlAzMe  
Posted: Friday, Jan 16 2009, 19:45
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 1, 2005

XXXXX



QUOTE (iriedreadlock23 @ Jan 16 2009, 19:22)
How do you get complete list of functions and variables you could use in scripts? I mean, script has something like this "...Dim weap As Weapon = Player.Character.Weapon
p.Weapon(weap).Ammo "... so how can i know what are all of object commands?

Try using the sln code example, it already has the references setup for intellisense to work.
PM
  Top
 

 
HazardX  
Posted: Friday, Jan 16 2009, 20:00
Quote Post


pedestrian mangler
Group Icon
Group: Members
Joined: Dec 13, 2008

gr.gif

XXXXX



QUOTE (basketballjones @ Jan 15 2009, 12:59)
is the list of objects/variables going to be extended to all of the same things that the c++ hook covers?
even those in the scriptingdirty.h (eventually)

To make a little clearer what KewlAzMe meant: You should use VisualStudio to edit the scripts (open the SLN files to get a functional VS project). It will tell you which classes and functions are available when they are required (for example pops a list up when you type a dot). this functionality is called "intellisense".

@KewlAzMe: No, it is not possible to change the AmmoType per script. You have to edit the WeaponInfo.xml to do this.

This post has been edited by HazardX on Friday, Jan 16 2009, 20:04
Users WebsitePM
  Top
 

 
KewlAzMe  
Posted: Friday, Jan 16 2009, 21:18
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 1, 2005

XXXXX



QUOTE (HazardX @ Jan 16 2009, 20:00)
QUOTE (basketballjones @ Jan 15 2009, 12:59)
is the list of objects/variables going to be extended to all of the same things that the c++ hook covers?
even those in the scriptingdirty.h (eventually)

To make a little clearer what KewlAzMe meant: You should use VisualStudio to edit the scripts (open the SLN files to get a functional VS project). It will tell you which classes and functions are available when they are required (for example pops a list up when you type a dot). this functionality is called "intellisense".

@KewlAzMe: No, it is not possible to change the AmmoType per script. You have to edit the WeaponInfo.xml to do this.

How about controlling player/vehicle relationships?
Like:

if p.Vehicle(v).HonkingHorn then
p.Vehicle(v).velocity = 400000
end if
etc.


Also, there is a "LeaveVehicle" but no "EnterVehicle" event. Can that be added?

This post has been edited by KewlAzMe on Friday, Jan 16 2009, 21:20
PM
  Top
 

 
iriedreadlock23  
Posted: Saturday, Jan 17 2009, 20:03
Quote Post


Dr. Frankenstein
Group Icon
Group: Members
Joined: Jan 14, 2009

XXXXX



Thank you very much.

I realized in the meanwhile. Installed VS2008, and problem solved. Im impressed with the way script works, excellent job. But im intrerested now in possibility to use other native functions. Is there any experimental wrap throughout your library, so i can call functions like SET_TAXI_LIGHTS... and such? It would be awesome, so it could extend functionality of scripts. I was working on a thing so when i press certain key, i get my bodyguards find closest vehicle, and get into it. But i need more native functions, to make them actually run in convoy and get them to drive any car behind the player. Also, to search transportation if passenger limit in players car is full.
PM
  Top
 

 
KewlAzMe  
Posted: Saturday, Jan 17 2009, 20:07
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 1, 2005

XXXXX



Is there a way to control people not in your group? Like World.Ped (doesn't work) but I'd like to create a script that sets all peds to be A) on fire and B) armed and attacking.

I've tried things like:

CODE
For Each iped As Ped In World
   iped.IsOnFire = true
Next


But "World" isn't right. Nor is Game, or Room, or anything else i've tried

This post has been edited by KewlAzMe on Saturday, Jan 17 2009, 20:09
PM
  Top
 

 
Intosia  
Posted: Saturday, Jan 17 2009, 20:12
Quote Post


I'm random! ^^
Group Icon
Group: Members
Joined: Dec 11, 2008

nl.gif

XXXXX



QUOTE (KewlAzMe @ Jan 17 2009, 20:07)
Is there a way to control people not in your group? Like World.Ped (doesn't work) but I'd like to create a script that sets all peds to be A) on fire and B) armed and attacking.

I've tried things like:

CODE
For Each iped As Ped In World
   iped.IsOnFire = true
Next


But "World" isn't right. Nor is Game, or Room, or anything else i've tried

I would like have access to "all" the cars/peds on screen aswell in the C++ Hook, but i think thats not possible without direct memory accessing. You CAN do GetClosestPed (if im correct).
Users WebsitePM
  Top
 

 
HazardX  
Posted: Saturday, Jan 17 2009, 20:16
Quote Post


pedestrian mangler
Group Icon
Group: Members
Joined: Dec 13, 2008

gr.gif

XXXXX



QUOTE (iriedreadlock23 @ Jan 17 2009, 20:03)
Thank you very much.

I realized in the meanwhile. Installed VS2008, and problem solved. Im impressed with the way script works, excellent job. But im intrerested now in possibility to use other native functions. Is there any experimental wrap throughout your library, so i can call functions like SET_TAXI_LIGHTS... and such? It would be awesome, so it could extend functionality of scripts. I was working on a thing so when i press certain key, i get my bodyguards find closest vehicle, and get into it. But i need more native functions, to make them actually run in convoy and get them to drive any car behind the player. Also, to search transportation if passenger limit in players car is full.

I hope to get the new release ready tonight. it includes a way to call native functions directly. here is an example:

CODE
     Dim CarPointer As New Native.Pointer(GetType(Vehicle))
     Native.Function.Call("GET_CAR_CHAR_IS_USING", Player.Character, CarPointer)

     Dim ModelPointer As New Native.Pointer(GetType(Model))
     Native.Function.Call("GET_CAR_MODEL", CarPointer.ToInputParameter, ModelPointer)

     Dim name As String = Native.Function.Call(Of String)("GET_DISPLAY_NAME_FROM_VEHICLE_MODEL", ModelPointer.ToInputParameter)


Also included are Tasks and TaskSequences. The included example shows how to enter every car as passenger, and force the driver to bring you to your currently selected waypoint. lol.gif But your idea is great. maybe i'll modify the included bodyguard example to make them use cars, if i've got enough time now, otherwise later.


@KewlAzMe: No, there is no way to do this right now. We haven't found a native function to achieve this, til now. As Intosia said, there are the World.GetClosestPed (which doesn't work very good at the moment) and World.GetClosestVehicle functions.

This post has been edited by HazardX on Saturday, Jan 17 2009, 20:20
Users WebsitePM
  Top
 

 
CoMPMStR  
Posted: Saturday, Jan 17 2009, 21:05
Quote Post


CoMPuTer MAsSteR
Group Icon
Group: Members
Joined: Dec 18, 2008

us.gif

XXXXX



Is there a way to write char position and velocity in the current release? I found Player.Character.Position and Player.Character.Velocity both get but neither allow setting.

Thanks for this greatness. Now it's as if GTA has it's own modding SDK VS plugin! This makes scripting and modding much easier with the intellisense. Can't wait for the next release! biggrin.gif happy.gif
PM
  Top
 

 
JKM  
Posted: Saturday, Jan 17 2009, 21:37
Quote Post


[BM] Projectleader
Group Icon
Group: Members
Joined: Jul 16, 2005

gr.gif

XXXXX



One little question:
Is Visual Basic 2008 working on Vista Home Premium 64bit?
Cause I downloaded and installed Visual Basic but there was no application i could start... only a debugger which didnt work....
PMICQ
  Top
 

 
olddawid  
Posted: Saturday, Jan 17 2009, 21:52
Quote Post


Crackhead
Group Icon
Group: Members
Joined: Jan 3, 2009

XXXXX



delete

This post has been edited by olddawid on Saturday, Jan 17 2009, 23:05
PM
  Top
 

 
HazardX  
Posted: Saturday, Jan 17 2009, 21:54
Quote Post


pedestrian mangler
Group Icon
Group: Members
Joined: Dec 13, 2008

gr.gif

XXXXX



QUOTE (JKM @ Jan 17 2009, 21:37)
One little question:
Is Visual Basic 2008 working on Vista Home Premium 64bit?
Cause I downloaded and installed Visual Basic but there was no application i could start... only a debugger which didnt work....

Usually it does work. Are you able to open the SLN files now? If not, try to install it again. Maybe something went wrong during installation.

@CoMPMStR:
Position and Velocity should be settable. This should push the player into the air:

Player.Character.Velocity += new Vector3(0,0,20)
Users WebsitePM
  Top
 

 
iriedreadlock23  
Posted: Saturday, Jan 17 2009, 22:49
Quote Post


Dr. Frankenstein
Group Icon
Group: Members
Joined: Jan 14, 2009

XXXXX



Im impatient for the new release. Is there any beta release? Maybe you could put what you have done so far, and we can test it, get some new ideas to the front. Im working on getting information from nearby peds, but im having problem with understanding function "GetClosestPed( Vector3, Single)... So what would be proper look of the function in use? What do i use for single? 1.0F, 6.0F? It should be like radius, so how do set proper radius in game metrics? Coz this way i get very random result, i dont know which ped gets found by this function.

Also, how can I put Peds back into a same game group? They sometimes go and kill each other. And I noticed that if you put like 10-20 guards, some of them dont follow you. I tried refreshing them, all one by one, with 'for each[I]' by SetPathFinding, but they just then go after me, start to shoot at me. Maybe it has to do that after player dies, game just remove all peds from your custom group...
PM
  Top
 

 
HazardX  
Posted: Saturday, Jan 17 2009, 23:06
Quote Post


pedestrian mangler
Group Icon
Group: Members
Joined: Dec 13, 2008

gr.gif

XXXXX



QUOTE (iriedreadlock23 @ Jan 17 2009, 22:49)
Im impatient for the new release. Is there any beta release? Maybe you could put what you have done so far, and we can test it, get some new ideas to the front. Im working on getting information from nearby peds, but im having problem with understanding function "GetClosestPed( Vector3, Single)... So what would be proper look of the function in use? What do i use for single? 1.0F, 6.0F? It should be like radius, so how do set proper radius in game metrics? Coz this way i get very random result, i dont know which ped gets found by this function.

Also, how can I put Peds back into a same game group? They sometimes go and kill each other. And I noticed that if you put like 10-20 guards, some of them dont follow you. I tried refreshing them, all one by one, with 'for each[I]' by SetPathFinding, but they just then go after me, start to shoot at me. Maybe it has to do that after player dies, game just remove all peds from your custom group...

I hope to get the new release up in the next hours.

The GetClosestPed functions is very tricky currently... you are right, the parameter is the distance (in meters/yards... at least almost). but thats not the problem. internally there are 2 more parameters that seem to control what kind of peds will be returned by the functions. however, i found no combination yet that gives reliable results.

Groups have a maximum number of members. for the player group it seems to be 7. As soon as you add more, one of them will just "fall out" of the group. the roblem is, that the function to get the maximum number of members is still completely unknown. i've got the name (FIND_MAX_NUMBER_OF_GROUP_MEMBERS) but noone seems to know which parameters it takes. i'll try to find it out though.
Users WebsitePM
  Top
 

 
iriedreadlock23  
Posted: Saturday, Jan 17 2009, 23:15
Quote Post


Dr. Frankenstein
Group Icon
Group: Members
Joined: Jan 14, 2009

XXXXX



Can you explain GTA.FunctionContext? Does it have to do something with calling native functions? There are lot of things when i declare new FunctionContext object. I see like 'GetArgumentFloat', 'GetArgumentInt','SetArgument'...'PushPtr'. How can i use it? If you could post some basic test code for it, it would be great.
PM
  Top
 

 
CoMPMStR  
Posted: Saturday, Jan 17 2009, 23:36
Quote Post


CoMPuTer MAsSteR
Group Icon
Group: Members
Joined: Dec 18, 2008

us.gif

XXXXX



QUOTE (HazardX @ Jan 17 2009, 15:54)
@CoMPMStR:
Position and Velocity should be settable. This should push the player into the air:

Player.Character.Velocity += new Vector3(0,0,20)

Ahh I see, I was doing Player.Character.Velocity.X = newVect.X. suicidal.gif Still have to get used to how it all works.. biggrin.gif
PM
  Top
 

 
iriedreadlock23  
Posted: Sunday, Jan 18 2009, 00:52
Quote Post


Dr. Frankenstein
Group Icon
Group: Members
Joined: Jan 14, 2009

XXXXX



I found out that you can use more than 7 guards by putting them into separate groups. 7+7+7... So basically you can have as many peds as you want as your bodyguards, following you and defending. Good thing is putting all used peds into an array, so you can control each one of them separately.

Maybe a good idea:

Is there possibility to control Ped movement? To script ped moves left or right on a key press or something like that. It could open up a new era of modding, and give a possibility to make your friend could use maybe a joypad2 on the system to control a bodyguard. Could you imagine GTA4 in full cooperative mod?
PM
  Top
 

 
HazardX  
Posted: Sunday, Jan 18 2009, 10:38
Quote Post


pedestrian mangler
Group Icon
Group: Members
Joined: Dec 13, 2008

gr.gif

XXXXX



NEW VERSION:

GTAIV .Net Script Hook v0.73 BETA

Changes in Version 0.73 BETA:
- Scripts reload now if the game reloads
- Fixed wrong color values
- Renamed many functions to make more sense (don't complain, i warned you wink.gif )
- also renamed Ped.Tasks to Ped.Task
- more examples (including the more complex AnyTaxiScript)
- new Classes/Functionality:
-> Many Tasks and TaskSequences for Peds
-> Native Function support (Native.Function.Call)
-> Minimal Camera support
-> Minimal Blip support
-> MANY more small things... smile.gif

The mentioned AnyTaxiScript allows you to enter any car as passenger and force the driver to bring you to a specific coordinate... as fast as possible.

Also very interesting are the new Tasks and TaskSequences. Use Ped.Task if you want to run a single task, or create a (reuseable) sequence of tasks with TaskSequence. Here is an example:
CODE
  Private FleeTask As New TaskSequence
  FleeTask.AddTask.SwapWeapon(Weapon.Handgun_Glock)
  FleeTask.AddTask.FightAgainst(Player, 5000) ' fight 5 sec
  FleeTask.AddTask.FleeFromChar(Player, False, 5000) ' flee 5 sec
  FleeTask.AddTask.Die() ' and then die

  ped.Task.PerformSequence(FleeTask)


Native calls are now possible too:
CODE
     Dim CarPointer As New Native.Pointer(GetType(Vehicle))
     Native.Function.Call("GET_CAR_CHAR_IS_USING", Player.Character, CarPointer)

     Dim ModelPointer As New Native.Pointer(GetType(Model))
     Native.Function.Call("GET_CAR_MODEL", CarPointer.ToInputParameter, ModelPointer)

     return Native.Function.Call(Of String)("GET_DISPLAY_NAME_FROM_VEHICLE_MODEL", ModelPointer.ToInputParameter)



@iriedreadlock23: The old FunctionContext class (which was for Lua-like native calling) has been replaced by the new and much better Native.Function.Call (see above).

This post has been edited by HazardX on Sunday, Jan 18 2009, 20:22
Users WebsitePM
  Top
 

 
iriedreadlock23  
Posted: Sunday, Jan 18 2009, 20:27
Quote Post


Dr. Frankenstein
Group Icon
Group: Members
Joined: Jan 14, 2009

XXXXX



Great!!

Thanks for the answers!

This is really great release, wonderful. I just love it. Now GTA4 can be modded, and extended to its full potential.

Can you tell me about 'VehicleDoor'? How can i use it? Like i want to get information into player vehicle. I get vehicle object, but i need now to access door. How do i set Hood to be opened?
PM
  Top
 

 
HazardX  
Posted: Sunday, Jan 18 2009, 20:49
Quote Post


pedestrian mangler
Group Icon
Group: Members
Joined: Dec 13, 2008

gr.gif

XXXXX



QUOTE (iriedreadlock23 @ Jan 18 2009, 20:27)
Great!!

Thanks for the answers!

This is really great release, wonderful. I just love it. Now GTA4 can be modded, and extended to its full potential.

Can you tell me about 'VehicleDoor'? How can i use it? Like i want to get information into player vehicle. I get vehicle object, but i need now to access door. How do i set Hood to be opened?

Thanks. smile.gif

VehicleDoor is just to open, close and break doors. The Hood is also handled as a door. just use them like this:

CODE
somevehicle.Door(VehicleDoor.LeftFront).Close()
or
somevehicle.Door(VehicleDoor.Hood).Open()


To get into a car you don't need to access the door. There is a task defined to enter a car. here is the example code:

CODE
Player.Character.Task.EnterVehicle(somevehicle, VehicleSeat.RightFront)


in both examples "somevehicle" is a variable of type "Vehicle".
Users WebsitePM
  Top
 

 
loczek47  
Posted: Monday, Jan 19 2009, 00:20
Quote Post


They call me "Random Funny Guy".
Group Icon
Group: BUSTED!
Joined: May 22, 2008

pl.gif

XXXXX



This is awesome , thank you so much for .cs , it reminds me CLEO for SA , makes making script easier
PM
  Top
 

 

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

0 Members:

Pages: (146) 1 [2] 3 4 ... Last »

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



 
IMG IMG