|
 |
|
|
|
|
|
GTA Modification Forums
[BETA] GTAIV .Net ScriptHook V1.6.1.1 Released 1.0.6.0 / EFLC Support
 |
|
 |
| |
fengyeblade  |
Posted: Wednesday, Aug 1 2012, 06:15
|
Blade Feng Land

Group: Members
Joined: Feb 1, 2009


|
I make a ped , add a task to enter vehicle. | CODE | GudList[z].Task.ClearAll(); GudList[z].Task.AlwaysKeepTask = true; GudList[z].Task.EnterVehicle(GudCar[0], VehicleSeat.Driver); |
and make he drive vehicle to a point. | CODE | if (GudList[z].isInVehicle(GudCar[0])) GudList[z].Task.DriveTo(endpoint, sspeed, false); |
but , in game, the ped get in car, get out ,get in ,get out , get in , get out .... he can't stay in the vehicle. how make he stay in the car , still i give he command?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
thaCURSEDpie  |
Posted: Thursday, Aug 23 2012, 14:25
|
GTA:IV scripter

Group: Members
Joined: Jul 1, 2007

|
EDIT: Below post is probably irrelevant since I've already spoken with some competent people. None of whom can think of a fix at the moment. Too bad. Since everyone in #gtaivnetscripthook seems afk I'll ask the question here. I'm building a function-hooking module. It's got an unmanaged base which does all the actually dirty work (patching in jmp's and the like). Then there's the .Net part which can 'register' with the unmanaged part. This part is meant to act as an intermediate to allow end-developers (in .Net) to not have to deal with the unmanaged base. The intermediate exposes methods which allow .Net code to register detour methods. So, say a hooked function is called (Let's take CPlayerChar::SetCharHealth as an example. If you don't agree with the naming, then too bad  ): Flow of execution would be: Game -> C++ module -> .Net intermediate -> .Net registered detours So in our case we luckily have the .Net scripthook, which we can use to host the registered detour methods. I made a test class: | CODE | // Delegates public delegate void Del_CPlayerChar_AddCharHealth(IntPtr CharInstance, int Instance, float amount); public delegate void Del_CPlayerChar_SetCharHealth(IntPtr CharInstance, float amount, int unkInt);
public class Example : GTA.Script { private Del_CPlayerChar_AddCharHealth AddCharHealthDetour_Del; private Del_CPlayerChar_SetCharHealth SetCharHealthDetour_Del;
private HookIntermediate hi; // Constructor public Example() { this.AddCharHealthDetour_Del = new Del_CPlayerChar_AddCharHealth(this.CPlayerChar_AddCharHealthDetour); this.SetCharHealthDetour_Del = new Del_CPlayerChar_SetCharHealth(this.CPlayerChar_SetCharHealthDetour);
// We get a reference to the HookIntermediate instance this.hi = HookIntermediate.Get();
// We register our detour. This works out fine. int retVal = hi.RegisterDetour("CPlayerChar::AddCharHealth", this.AddCharHealthDetour_Del); }
private void CPlayerChar_SetCharHealthDetour(IntPtr CharInstance, float amount, int unkInt) { // This function is then called when the hooked function is called. The values are all correct, but the game hangs when the next line is executed: Game.Console.Print("Player health set to: " + amount.ToString()); } }
|
When the detour method is called, everything works out *until* the moment a .net scripthook method is called (for example: Game.Console.Print() ). It seems it's not possible to call these methods from a different thread than the script-thread. Is this true? The HookIntermediate is initialized (if it not yet exists) in the Get() method, so we are also always in the same AppDomain as the .net scripthook (SHDN_ScriptDomain  , yes, I've checked). So the question is: how should I deal with this? Is there really no way to call for example Game.Console.Print() from any other thread? This post has been edited by thaCURSEDpie on Monday, Aug 27 2012, 19:42
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
gtaivEflc  |
Posted: Tuesday, Sep 25 2012, 15:05
|
Player Hater

Group: Members
Joined: Nov 1, 2011

|
Hello everybody!
I've found a bug or something like this.. There is no information about GET_STATE_OF_CLOSEST_DOOR_OF_TYPE native function, so I opened some .sco scripts and saw something like this: GET_STATE_OF_CLOSEST_DOOR_OF_TYPE( iVar5, vVar6[0], ref uVar3, ref uVar4 ); (ray6.sco) So, iVar5 is model hash, vVar6 is door location (Vector3), ref uVar3 is locked/unlocked, ref uVar4 is door rotation angle. The problem is -- uVar3 and uVar4 are ref. GTA.Native.Function.Call("GET_STATE_OF_CLOSEST_DOOR_OF_TYPE", model.Hash, location.X, location.Y, location.Z, ref locked, ref angle) is incorrect! Parameter can't be 'ref'. Please solve this problem!
This post has been edited by gtaivEflc on Tuesday, Sep 25 2012, 15:13
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Max4X  |
|
Player Hater

Group: Members
Joined: Jun 14, 2008


|
Hi everyone! Does anybody know what all these errors mean in my ScriptHookDotNet log file? I don't know why but net scripts don't work in my game (1.0.0.4). I have everything installed for it including .net framework 4. Here is my log: | CODE | 2012-09-30 22:44:14 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.0.4 with C++ Hook version 0.4.0)
2012-09-30 22:44:14 - WARNING: Your C++ ScriptHook version 0.4.0 and GTA IV version 1.0.0.4 are NOT known to be compatible! Use C++ ScriptHook version 0.5.1 or the newest version of the game AND the C++ ScriptHook instead! 2012-09-30 22:44:45 - Direct3D device created! 2012-09-30 22:44:45 - Error during ScriptDomain.Create: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at GTA.RemoteScriptDomain..ctor() --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo) at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName) at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName) at GTA.ScriptDomain.Create() 2012-09-30 22:44:45 - -> InnerException: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at GTA.RemoteScriptDomain..ctor() 2012-09-30 22:44:45 - INFO: Phone number checks are not available! 2012-09-30 22:47:41 - Direct3D device lost! |
So is there any errors which could stop running the scripts?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:
Pages:
(146) « First ... 142 143 [144] 145 146
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|