Posts: 273
Threads: 14
Joined: Aug 2012
Reputation:
17
Would it be possible to add the KillPlayer() function to the extensions? I can't use it because I'm using addon version 1.413 and I don't think anyone will fix or update the addon anytime soon.
Thanks in advance!
Posts: 836
Threads: 48
Joined: Feb 2012
Reputation:
11
if the memory bug could be fixed that would be a start
Posts: 1
Threads: 0
Joined: May 2013
Reputation:
0
Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
01-02-2014, 04:26
(This post was last modified: 01-02-2014, 04:45 by master131.)
Eh, got bored and thought I'd revive it. I've fixed Timing.cs, should no longer crash for people, thanks to @ NTAuthority and *cough* Pigophone. Also, the .As<T> function can now take a bool. I've also added a Timing.Notify example that switches the player's team.
A casual conversation between barata and I about Nukem.
Posts: 299
Threads: 1
Joined: Aug 2013
Reputation:
10
nice, just wondering is there a way to have anything other than care packages solid
Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
01-02-2014, 06:48
(This post was last modified: 01-02-2014, 06:49 by master131.)
(01-02-2014, 06:25)Casper Wrote: nice, just wondering is there a way to have anything other than care packages solid
That would be the SetContents function, I've played around with it in MW2 and it works miracles with map-specific xmodels (eg. playground slide or ice-cream sign from Favela). I'd have to port that over, shouldn't be too hard.
A casual conversation between barata and I about Nukem.
Posts: 245
Threads: 79
Joined: Feb 2013
(01-02-2014, 06:48)master131 Wrote: (01-02-2014, 06:25)Casper Wrote: nice, just wondering is there a way to have anything other than care packages solid
That would be the SetContents function, I've played around with it in MW2 and it works miracles with map-specific xmodels (eg. playground slide or ice-cream sign from Favela). I'd have to port that over, shouldn't be too hard. Thanks.
Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
01-02-2014, 07:34
(This post was last modified: 01-02-2014, 08:25 by master131.)
Done, check the main post for updated code. To make a model solid (other than a carepackage), use:
Code: Extensions.SetContents(entity, 1);
To make it non-solid again, use:
Code: Extensions.SetContents(entity, 0);
Note: It's buggy on some models, because it literally makes a hidden box in the middle of the model to make it "solid". If you try it on the "vehicle_hummer_destructible" model in Dome, you'll notice you can still walk through the edges of the car but the middle is "solid". It works best with non-destructible stuff I believe.
Edit: Looks like the game is still crashing, might be Timing.cs again, I'm going to use a debugger and find out what's going on.
Edit #2: Yup, it's from the hook again, and I'm pretty sure I found the problem. The GC (garbage collector) is probably deleting/freeing the stub from Marshal.GetFunctionPointerFromDelegate because it assumes that I don't need it anymore (I only stored it in a local variable and used it once). Storing the variable as a global variable should solve the problem. After doing a search to prove my theory, I found this:
Quote:.NET disposes the function pointer when the delegate goes out of scope. Be really careful that your delegate remains in scope for the duration of time that the unmanaged code can call back - otherwise you'll potentially end up with a call to invalid memory triggering a process crash.
I've edited the main post again, should be stable now.
A casual conversation between barata and I about Nukem.
Posts: 245
Threads: 79
Joined: Feb 2013
01-02-2014, 08:38
(This post was last modified: 01-02-2014, 08:39 by [HARD] Tony..)
(01-02-2014, 07:34)master131 Wrote: Done, check the main post for updated code. To make a model solid (other than a carepackage), use:
Code: Extensions.SetContents(entity, 1);
To make it non-solid again, use:
Code: Extensions.SetContents(entity, 0);
Note: It's buggy on some models, because it literally makes a hidden box in the middle of the model to make it "solid". If you try it on the "vehicle_hummer_destructible" model in Dome, you'll notice you can still walk through the edges of the car but the middle is "solid". It works best with non-destructible stuff I believe.
Edit: Looks like the game is still crashing, might be Timing.cs again, I'm going to use a debugger and find out what's going on.
Edit #2: Yup, it's from the hook again, and I'm pretty sure I found the problem. The GC (garbage collector) is probably deleting/freeing the stub from Marshal.GetFunctionPointerFromDelegate because it assumes that I don't need it anymore (I only stored it in a local variable and used it once). Storing the variable as a global variable should solve the problem. After doing a search to prove my theory, I found this:
Quote:.NET disposes the function pointer when the delegate goes out of scope. Be really careful that your delegate remains in scope for the duration of time that the unmanaged code can call back - otherwise you'll potentially end up with a call to invalid memory triggering a process crash.
I think would be cheerful if to add bots. they are OnNotify(joined_spectators). it would be cheerful, better than to play with people here an example.
http://youtu.be/UqPO8Rofb0g
Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
01-02-2014, 08:46
(This post was last modified: 01-02-2014, 08:50 by master131.)
(01-02-2014, 08:38)[HARD] Tony. Wrote: I think would be cheerful if to add bots. they are OnNotify(joined_spectators). it would be cheerful, better than to play with people here an example.
http://youtu.be/UqPO8Rofb0g
Will do. Also, I edited Timing.cs again because the correct way to solve the issue is mentioned here on MSDN using a GCHandle:
http://msdn.microsoft.com/en-us/library/367eeye0.aspx
EDIT - The GSC function AddTestClient is null-sub'ed, aka, it's been emptied out so it does absolutely nothing. I remember @ NTAuthority made an modification which allowed it, will dig in and figure it out.
EDIT #2 - This looks like quite a bit of work to do, there's alot for me to patch and port to C#, I'll do it when I have time, I'm currently working on something else right now that's not MW3 related.
A casual conversation between barata and I about Nukem.
|