Quantcast

Jump to content

» «
Photo

Detect "owner" or "creator" of game object

41 replies to this topic
julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#31

Posted 22 April 2014 - 07:58 AM Edited by julionib, 22 April 2014 - 08:05 AM.

Ok see if this fixes your issue, haven't properly tested myself yet, supports IV patch 7 and EFLC patch 2 (source included).

Place limits.asi wherever your asi loader requires then just run the game as usual.

 

http://jenksta.iv-m....ion_cleanup.zip

hey man i tested the code and seems to work but it cant completely fix the issue, how much you incremented the "limit"?

also i have a error msg every time game starts but after this error messages i can proceed loading game

Untitled.jpg

maybe because of this error the .asi file is not working, the address is 0 on ASILog.txt while others .asi files load in "non zero" memory address:
 

Loading ASI E:\Program Files X\Grand Theft Auto IV 1.0.7.0\limits.asi
ASI loaded : E:\Program Files X\Grand Theft Auto IV 1.0.7.0\limits.asi, Address 0x00000000
 
 
edit: i fixed error msg making a copy of the DLL to gtaiv.exe folder, but it still being loaded in 0x00000, this is normal?

jenksta
  • jenksta

    Player Hater

  • Members
  • Joined: 22 Dec 2008
  • United-Kingdom

#32

Posted 23 April 2014 - 05:06 AM

Hi the error is due to the msvc runtime used to compile it, if you have visual studio installed just compile it locally and use that and it should work fine. Either that or download the latest msvc runtime for vs2013. As for the limit it should be double what it was before (256->512). Although as I said I never thoroughly tested it with reproducing your issue so any problems feel free to post them and I'll try my best to fix them.

pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#33

Posted 24 April 2014 - 06:15 PM

I must have spent like 40min to an hour debugging a freaking script that was crashing constantly at loading, only to find out it was because of the issue discussed in here, just reloaded the game and the problem was fixed.. arh! What a pain...


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#34

Posted 24 April 2014 - 08:25 PM

how you debug?


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#35

Posted 24 April 2014 - 09:53 PM

how you debug?

 

That's a good question. Actually I can only debug using code isolation techniques, because I make heavy use of AdvancedHook.dll and it stops every time I attach a debugger to it. Which is extremely annoying in most situations.

 

But if you don't use any binary that prevents debuggers from attaching to it, you can place normal breakpoints in your code and attach GTA.exe to Visual Studio, and I bet you didn't know that ;D. Under the menu option 'DEBUG' there is the 'Attach to Process' option, just have your script running already and attach GTA.exe to Visual Studio, sometimes is a bit weird, but 99% works like a charm. Too bad those guys at LCPD:FR are bunch of retarded ego full developers and prevented debuggers to attach to their AdvancedHook,dll.

  • LordOfTheBongs likes this

NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Best Conversion 2014 [ViIV for GTANY]
    Most Knowledgeable [Tech] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Contribution Award [Mods]

#36

Posted 25 April 2014 - 12:09 AM Edited by NTAuthority, 25 April 2014 - 12:09 AM.

>attaching at a later time

ha, my method is better in allowing you to just F5, but sadly I can't post it here as a side effect of it is that it is a crack :(


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#37

Posted 25 April 2014 - 12:42 AM

put it on pastebin ;)


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#38

Posted 25 April 2014 - 12:51 AM

lol my actual "debug" method is put console + screen messages, i need to improve this ^^


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#39

Posted 25 April 2014 - 03:37 AM

lol my actual "debug" method is put console + screen messages, i need to improve this ^^

it works


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#40

Posted 25 April 2014 - 07:26 AM

lol my actual "debug" method is put console + screen messages, i need to improve this ^^

 

Yeah that's my last method, and it is a bit painful.


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#41

Posted 25 April 2014 - 08:45 AM

>attaching at a later time

ha, my method is better in allowing you to just F5, but sadly I can't post it here as a side effect of it is that it is a crack :(

 

Will it solve my problem with anti-debugger code in AdvancedHook.dll? If yes, I'm interested.

 

And you can post it even if the side effect is being a crack, what can't be done is, oh look this is how you crack GTA IV, which you just did, or at least started, if you haven't said that you could have just posted your debugging solution. But you can always PM me.


AgentWD40
  • AgentWD40

    GLITCHED

  • Members
  • Joined: 02 May 2009
  • Philippines

#42

Posted 02 August 2014 - 10:14 AM Edited by hardsty1e, 06 August 2014 - 03:07 PM.

stumbled across this code, should help detect which objects/peds/vehicles are yours even when script crashes or reloading scripts. :turn:

 

c#

public static int MemoryAddress(this GTA.Object obj)
        {
            PropertyInfo info = typeof(GTA.Object).GetProperty("MemoryAddress", BindingFlags.NonPublic | BindingFlags.Instance);
            int address = (int)info.GetValue(obj, null);

            return address;
        }

vb

Public Shared Function MemoryAddress(obj As GTA.Object) As Integer
	Dim info As PropertyInfo = GetType(GTA.Object).GetProperty("MemoryAddress", BindingFlags.NonPublic Or BindingFlags.Instance)
	Dim address As Integer = CInt(info.GetValue(obj, Nothing))

	Return address
End Function




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users