Quantcast

Jump to content

» «
Photo

[TUT] How to create VB.Net scripts

62 replies to this topic
julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#31

Posted 14 May 2013 - 04:59 AM

QUOTE (123iamking @ Monday, May 13 2013, 07:24)
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
CODE
....
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.gif cookie.gif

no, you probably downloaded the link that came before the soundsDemo hehe, that link is the script used in the tutorial.

this link: http://pastebin.com/1AFvAA16



the link for the sound demo is in the sound demo section:

"The Sounds demo script and the sounds list

Maybe you are asking yourself now: Where i can find the name of the game sounds to use? Here.

Press Control+S to save the file in your Scripts folder, save with the name sounds.txt, why? Because you will use this txt file with my Sound Demo script, so, download the script and the sounds.txt file and put in your Scripts folder, in the game press " to see the console window, type the command "sd" to enable the script:"

this is the link: http://pastebin.com/hN27pq2W

also you will need to sounds.txt file:

https://docs.google....dit?usp=sharing




i did some improves in that soundsDemo script, i updated the pastebin post wtih the new code

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#32

Posted 14 May 2013 - 05:04 AM

QUOTE (Nevitro @ Monday, May 13 2013, 11:52)
Julio, You should add instruction how add screen effect tutorial smile.gif

Like draw sprites on screen using graphics event?

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#33

Posted 14 May 2013 - 05:17 AM

QUOTE (123iamking @ Tuesday, May 14 2013, 01:38)
A mod would not be completed if u miss "Animation" smile.gif

yes, i will add an tutorial about what i know about anims ^^

Nevitro
  • Nevitro

    Modder

  • Members
  • Joined: 31 Mar 2009

#34

Posted 14 May 2013 - 06:02 PM

QUOTE (julionib @ Tuesday, May 14 2013, 05:04)
QUOTE (Nevitro @ Monday, May 13 2013, 11:52)
Julio, You should add instruction how add screen effect tutorial smile.gif

Like draw sprites on screen using graphics event?

No, i mean blood effect in chainsow mod smile.gif

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#35

Posted 14 May 2013 - 11:57 PM

QUOTE (Nevitro @ Tuesday, May 14 2013, 18:02)
QUOTE (julionib @ Tuesday, May 14 2013, 05:04)
QUOTE (Nevitro @ Monday, May 13 2013, 11:52)
Julio, You should add instruction how add screen effect tutorial smile.gif

Like draw sprites on screen using graphics event?

No, i mean blood effect in chainsow mod smile.gif

ah, the blood drips on screen? ok i will release that source soon, will be in the Classes tutorial

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#36

Posted 15 May 2013 - 01:21 AM

QUOTE (Nevitro @ Tuesday, May 14 2013, 18:02)
No, i mean blood effect in chainsow mod smile.gif

done man:

http://gtaxscripting...om-classes.html

the source code of chainsaw is in the blog post, also i explain the idea behind the blood drips (classes)

Nevitro
  • Nevitro

    Modder

  • Members
  • Joined: 31 Mar 2009

#37

Posted 16 May 2013 - 02:51 PM

Okey thanks smile.gif

123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011
  • None

#38

Posted 23 May 2013 - 02:45 PM

Can you upload the source code of Iron man IV script ? I saw u got a lot of examples from that script smile.gif

123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011
  • None

#39

Posted 24 May 2013 - 02:13 AM

Is there anyway to make the "camera chase the bullet" like in some pfs games (when we do the execution) ? smile.gif

girish_is_gay
  • girish_is_gay

    Player Hater

  • BUSTED!
  • Joined: 23 May 2013

#40

Posted 24 May 2013 - 02:37 AM

yes, u can create a new camera and make it travel somewhere at a desired speed, maybe add sound sfx and u have a bullet cam, ur not actually tying the camera to a bullet u just control a cmaera and when camera hits a ped u can then trigger a bullet to hit them with a native function

have u downloaded the freecam by ra's al ghul? that shows u how to move a camera but that is moving camera with joystick

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#41

Posted 25 May 2013 - 03:42 AM

QUOTE (123iamking @ Thursday, May 23 2013, 14:45)
Can you upload the source code of Iron man IV script ? I saw u got a lot of examples from that script smile.gif

here goes:

http://gtaxscripting...ource-code.html

scroll to the end of the post and you will see the link


obs.: it's a mess, more organized than Ghost Rider but still a mess ^^

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#42

Posted 06 June 2013 - 12:10 AM

Added two tuts: Ped flight ideas and tutorial about animations

Nevitro
  • Nevitro

    Modder

  • Members
  • Joined: 31 Mar 2009

#43

Posted 06 June 2013 - 06:27 AM

Julio, i saw animation flags and You did not include:

-flag without animation for legs
Mayby this is not important, but i think You should add this. I remeber [not sure] the flag number 09 play without legs.


QUOTE

SET_CHAR_ANIM_CURRENT_TIME - We can use this method to set the animation time, 1.0 is 100%, the end, 0 is the start, very useful to control the animation, we can make and fake reverse playback reducing the percent number, params: ped, category name, animation name and playback percent/100 (from 0 to 1.0)


I did not know that! Thanks! smile.gif

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#44

Posted 06 June 2013 - 01:34 PM

QUOTE (Nevitro @ Thursday, Jun 6 2013, 06:27)
Julio, i saw animation flags and You did not include:

-flag without animation for legs
Mayby this is not important, but i think You should add this. I remeber [not sure] the flag number 09 play without legs.


QUOTE

SET_CHAR_ANIM_CURRENT_TIME - We can use this method to set the animation time, 1.0 is 100%, the end, 0 is the start, very useful to control the animation, we can make and fake reverse playback reducing the percent number, params: ped, category name, animation name and playback percent/100 (from 0 to 1.0)


I did not know that! Thanks! smile.gif

mmm, the 09 was there but i used incorrect explanation, this seems to be indicated to use while inside vehicles.

thx

Nevitro
  • Nevitro

    Modder

  • Members
  • Joined: 31 Mar 2009

#45

Posted 09 June 2013 - 09:12 PM

Julio, You need do more tests... the:
QUOTE

SET_CHAR_ANIM_CURRENT_TIME - We can use this method to set the animation time, 1.0 is 100%, the end, 0 is the start, very useful to control the animation, we can make and fake reverse playback reducing the percent number, params: ped, category name, animation name and playback percent/100 (from 0 to 1.0)


is not TRUE!

This use time how long play current animation, NOT from what point of time. So, You can not do reverse animation.
1.0 - not play anim
0.5 - ped will play half animation.
0.0 - play normal all anim

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#46

Posted 09 June 2013 - 09:34 PM

here im my tests works like i said in tutorial, for example in my Hulk mod im using:

CODE
Dim tmpAnimTime As Double = Player.Character.Animation.GetCurrentAnimationTime(animSetClimb, animAirFalling)

               If tmpAnimTime >= 0.6 Then
                   If tmpAnimTime < 0.75 Then
                       jumpAnimPercentModifier = 0.007
                   ElseIf tmpAnimTime > 0.95 Then
                       jumpAnimPercentModifier = -0.007
                   End If

                   jumpAnimPercent += jumpAnimPercentModifier

                   Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, animSetClimb.Name, animAirFalling, 0.1)
                   Native.Function.Call("SET_CHAR_ANIM_CURRENT_TIME", Player.Character, animSetClimb.Name, animAirFalling, jumpAnimPercent)
               Else
                   jumpAnimPercent = 0.6
                   Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, animSetClimb.Name, animAirFalling, 1.2)
               End If


i call this in the main tick of the script, but even if you call just one time it works fine

Nevitro
  • Nevitro

    Modder

  • Members
  • Joined: 31 Mar 2009

#47

Posted 09 June 2013 - 10:23 PM Edited by Nevitro, 09 June 2013 - 10:28 PM.

FIXED

Game just laggy... You need or big scripts like Yours or put Wait, because script task to play animation... but he just play animation after set of time... Some interval between play and set what point to use - is IMPORTANT.

Please, put this warning in tutorial.

Thanks and sorry.

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#48

Posted 09 June 2013 - 11:45 PM

oh yeah

hehe

i usually use 100 as time wait before start checking anim playing or set anything related to anim

123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011
  • None

#49

Posted 26 July 2013 - 11:03 AM

Can you make Tut about draw things (adding picture, load texture available in game) on the screen and effect (like make pictures slowly blur and disappear) ?
Your TUT is awesome icon14.gif icon14.gif

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013
  • Poland

#50

Posted 26 July 2013 - 02:17 PM

Blur? I do not think this is possible ;P But never tried... ;p JulioNib? smile.gif

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#51

Posted 26 July 2013 - 10:33 PM

the blur i dont know, but i will write a tut about what i know about drawing on screen using event and methods

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#52

Posted 27 July 2013 - 06:49 PM

tutorial done and added to the list, take a look:

http://gtaxscripting...-on-screen.html

unfortunately i didnt find anything related to blur or semi transparent image draw sad.gif

pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#53

Posted 27 July 2013 - 08:51 PM

QUOTE (julionib @ Saturday, Jul 27 2013, 18:49)
unfortunately i didnt find anything related to blur or semi transparent image draw sad.gif

Isn't transparency part of a png graphics file ?

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#54

Posted 27 July 2013 - 09:20 PM

yes, but the idea is change it in script, like fade in and out

123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011
  • None

#55

Posted 28 July 2013 - 02:26 AM

QUOTE (julionib @ Friday, Nov 2 2012, 22:51)
Drawing things on screen (lines, rectangles, images, game images, etc.)

Wow , It's cool icon14.gif icon14.gif icon14.gif Thanks man cool.gif
I had a question , Can we make a HUD which show player character's face all the time (using the cellphone 's camera) ?
(like in Doom 2 , you know )

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#56

Posted 28 July 2013 - 03:41 AM

well, we can have some predefined PNG, based on player health lose we can change the face to pain, when shooting we can change to rage expression.

the e.graphics.drawSprite can handle it

123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011
  • None

#57

Posted 19 August 2013 - 02:26 AM

Can you make TUT 'bout camera please smile.gif ?
PS :
btw , 'bout your Iron IV mod, it's great , I think it's the best mod I ever play , but you added the native function "SET_DRAW_PLAYER_COMPONENT" (that makes the body part visible , not invisible one) in a tick method , that causes every milli-seconds the script call that function (even when the Iron man's suit is not activated) . therefore , your Iron man mod make my Hollow man mod (just a mod make the player "no head") unusable - every time I make the player's head invisible , your Iron man script make his head visible again . Can you fix that please smile.gif ? thanks for reading smile.gif

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#58

Posted 19 August 2013 - 05:54 AM

maybe, need to rethink my code

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#59

Posted 28 August 2013 - 09:04 PM

added simple menu class tut

next: cameras

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013
  • Poland

#60

Posted 29 August 2013 - 04:26 PM

Classes...
Okey i did not understand much.
There is just something as a "foreach" many times in tick?
Old tutorials was good, because "step to step" but now... i see "okey, X= 10, Y=20... oh sh*t" biggrin.gif

What is floating peds? A list?
What is doing the "tick" on down? [floatingPeds©.Tick()]? Just run the general tick again?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users