Quantcast

Jump to content

» «
Photo

Is there Mouse Move Event for scripthook.net?

11 replies to this topic
123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011

#1

Posted 16 July 2014 - 02:19 AM

I can see there are Key Mouse UP event, Key Mouse DOWN event, but it's just the same with KeyDown Event - Only call when a key is pressed.
Currently, If anything to do with Mouse Moving, I use Tick event; but it's just a temporary solution. Is there Mouse Move event - Call when my mouse starts moving?
Thanks for reading :)

LetsPlayOrDy
  • LetsPlayOrDy

    Too fast for ya

  • Members
  • Joined: 24 Aug 2013
  • United-States

#2

Posted 16 July 2014 - 03:05 AM Edited by LetsPlayOrDy, 16 July 2014 - 03:06 AM.

Maybe try this: http://stackoverflow...orm-application (look at answers).
I have no idea if it'll work, I've never tried it before.

123iamking
  • 123iamking

    Who am I?

  • Members
  • Joined: 21 Jan 2011

#3

Posted 16 July 2014 - 08:16 AM Edited by 123iamking, 16 July 2014 - 08:18 AM.

@LetsPlayOrDy:
Thanks, but I had found and read that before I started this topic.

leftas
  • leftas

    C++ for hacks/mods, C# for everything else.

  • Members
  • Joined: 13 Jun 2013
  • Lithuania

#4

Posted 16 July 2014 - 09:23 AM

Itself scripthook.net doesn't have. You need to use .net framework sh*t.
P.S. if scripthook.net would have mouse detection. I think it would use .net framework :)

Best Regards,
Paul.
  • LetsPlayOrDy likes this

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#5

Posted 18 July 2014 - 06:03 PM Edited by Michael Wojtanis, 18 July 2014 - 06:19 PM.

extern void GET_MOUSE_INPUT(int *x, int *y);

 

Come on.

Just start think.

 

How i remeber this should show how much mouse move per frame or something like that.

 

Example - mouse move half screen of 1024 - input will be nearly 512.

Test it.

 

 

Please use NATIVES. They have 70% of power in coding right now.

25% is matemathic [example - my WeapokWheel mod on all screens or JulioNIB spiderman mod - the spiderman just have smooth moving,many times i saw something like parabola]

  • hardsty1e likes this

leftas
  • leftas

    C++ for hacks/mods, C# for everything else.

  • Members
  • Joined: 13 Jun 2013
  • Lithuania

#6

Posted 18 July 2014 - 07:31 PM

Why use natives, when there are wrapped natives (Functions) which are easier and better to use ? But maybe I didn't understand correctly ur sentence ?
And about get_mouse_input. It's in scripthook.net ? If yes, then I just didn't find this, else he is asking in scripthook.net and .net framework would be better than imported func., but not sure because I don't use mouse input, but also wrapped func. Better than imported. :)

Best Regards,
Paul.

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#7

Posted 18 July 2014 - 08:05 PM Edited by Michael Wojtanis, 18 July 2014 - 08:18 PM.

Natives is in GAME.

Natives is R* job. They made them to make fast and easy making scripts.

 

ScriptHookDotNet is loaded in game. GTA -> ScripthookDotNet. I think better is using natives calls.

 

I will make small test...

 

PS.

Give me

"...when there are wrapped natives (Functions) which are easier and better to use..."

 

I can't find it in C# right now. In my mind i just see that to check position and change it every frame...


leftas
  • leftas

    C++ for hacks/mods, C# for everything else.

  • Members
  • Joined: 13 Jun 2013
  • Lithuania

#8

Posted 18 July 2014 - 08:27 PM Edited by leftas, 18 July 2014 - 08:33 PM.

Yes I know.

I made tests earlier,if I remember correctly wrapped functions was a bit faster.
Also wrapped functions, make job easier like checks,blips .net scripthook identify for what you need to attach, check and etc. I think you get my point.

A little correct
GTA iv-->scripthook(other scripts can disable .net scripthook, which is bad)-->scripthook.net

Edit:
You need example why it's better and easier ? I wrote above.

Edit2:
Also these "auto-identify" makes scripthook.net little bit slower :)

Best Regards,
Paul.

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#9

Posted 18 July 2014 - 08:32 PM

But what test You did?

Show the code.

 

If You just duplicate the function what is in ScriptHookDotNet and use same in Native - of course ScriptHookDotNet will call it faster.

But if You want call c# function what is in dll, then i think, Native will be faster.

 

leftas - if Yo do not know what to check and attach then You are just new on forum i see.

Most good codders have "natives.txt" check it on forum. This is file of all natives with description of natives.


leftas
  • leftas

    C++ for hacks/mods, C# for everything else.

  • Members
  • Joined: 13 Jun 2013
  • Lithuania

#10

Posted 18 July 2014 - 08:41 PM Edited by leftas, 18 July 2014 - 09:03 PM.

What ? What you talking about ? What you mean " I don't know what to check "??? What the f*ck, dude ? I'm saying that auto-identify makes job a lot easier... And I just said that natives has always different check or attach or create functions for different objects.

In what DLL ? In Your script or what ? Yes that's what I am talking about it's faster to call functions in scripthook than calling natives.

I made these tests a long time ago, I don't have code now.

Best Regards,
Paul.

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#11

Posted 18 July 2014 - 09:13 PM

Tested.

Calling Native is longer, that is right. Nearly 1/8 more than calling position from ScriptHookDotNet.

Leftas - yeah, easier but in future after many mods You will just automatic know what to put there and ScriptHookDotNet NOT HAVE all natives. This is biggest problem. Sometimes we NEED USE natives. Also - "I just said that natives has always different check or attach or create functions for different objects." - what that does mean exactly? You mean diffrent return values [int, float etc] and paramteres?

 

Here is my code. K and L key.

K - native call.

L - ScriptHookDotNet call.

using System;
using GTA;
using System.Threading;
namespace TestScript1
{
    public class TestScript1_SCRIPT : Script
    {
        
       
        System.Diagnostics.Stopwatch czasownik;
        
        public TestScript1_SCRIPT()
        {
            czasownik = new System.Diagnostics.Stopwatch();
            this.BindKey(System.Windows.Forms.Keys.K,new KeyPressDelegate(TESTCODE));
            this.BindKey(System.Windows.Forms.Keys.L, new KeyPressDelegate(TESTCODEtwo));
        }
        public void TESTCODE()
        {
            
            GTA.Native.Pointer x, y, z;
            x = typeof(float);
            y = typeof(float);
            z = typeof(float);
            czasownik.Reset();
            Wait(20);
            Game.Console.Print("TEST ---------- NATIVES ");
            czasownik.Start();
            GTA.Native.Function.Call("GET_CHAR_COORDINATES",Player.Character, x, y, z);
            Game.Console.Print("X: "+x+"\nY: "+y+"\nZ: "+z);
            czasownik.Stop();
            
            Game.Console.Print("END TEST ++++++++++++ NATIVES : " + czasownik.Elapsed);
            
            
        }
        public void TESTCODEtwo()
        {
            Vector3 test2;
            czasownik.Reset();
            Wait(20);
            Game.Console.Print("TEST ---------- normal");

            czasownik.Start();

            test2 = Player.Character.Position;
            Game.Console.Print("X: " + test2.X + "\nY: " + test2.Y + "\nZ: " + test2.Z);
            czasownik.Stop();
            
            Game.Console.Print("END TEST +++++++ normal : "+czasownik.Elapsed);
            
        }
        
    }
  
}
  • leftas likes this

leftas
  • leftas

    C++ for hacks/mods, C# for everything else.

  • Members
  • Joined: 13 Jun 2013
  • Lithuania

#12

Posted 18 July 2014 - 09:43 PM Edited by leftas, 19 July 2014 - 06:36 AM.

Yes, you coded a much more mods than me, but still I will more prefer wrapped functions if it exists in .net scripthook.
And by saying that I meant to say that for checking attaching etc. You need diff. Calls like for example(is_blip_exists, attach_blip_for_ped,is_ped_exists,attach_blip_for_vehicle)(it's just for example).
And yes I know that scripthook has not all natives, but it's better than nothing, right ?

Best Regards,
Paul.

  • Michael Wojtanis likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users