Oct 4 2010, 08:25 AM Post #1 | |
Ameteur Member Posts: 48 Joined: 19-August 10 | I was posted that on SB forum but nobody respond to it, so i post it there. In sources, guess what, i found these: CODE bool CVehicleSA::IsSphereTouchingVehicle ( CVector * vecOrigin, float fRadius ) { DEBUG_TRACE("bool CVehicleSA::IsSphereTouchingVehicle ( CVector * vecOrigin, float fRadius )"); DWORD dwThis = (DWORD) m_pInterface; DWORD dwFunc = FUNC_CVehicle_IsSphereTouchingVehicle; bool bReturn = false; _asm { push eax mov ecx, dwThis mov eax, vecOrigin push fRadius push dword ptr [eax] push dword ptr [eax + 4] push dword ptr [eax + 8] call dwFunc mov bReturn, al } return bReturn; } Is there a way to move this on delphi for creating opcode "is_car_visible"? Or way to find out current entity target of the camera. Any answers will be helpful! |
Oct 4 2010, 11:30 AM Post #2 | |
The master of cut retort Posts: 239 From: Warsaw, PL Joined: 21-July 10 | Is car visible == is set_car_visibility opcode set to 0? I'm not sure if you're asking that, or just you want to create condition, that will return true if car is on screen? |
Oct 4 2010, 03:54 PM Post #3 | |
Ameteur Member Posts: 48 Joined: 19-August 10 | Is car really entity target of camera, it means on screen, even if player stand near car but camera isnt looking at car. |
Oct 4 2010, 06:35 PM Post #4 | |
The master of cut retort Posts: 239 From: Warsaw, PL Joined: 21-July 10 | SANNY 02CA: car 61@ bounding_sphere_visible ? Nah, I don't think that you're a noob This post has been edited by Silent: Oct 4 2010, 06:35 PM |
Oct 5 2010, 10:34 AM Post #5 | |
Ameteur Member Posts: 48 Joined: 19-August 10 | Oh jesus... I KNOW THAT! I talking about not that opcode, i talking about camera's target_entity check. |
Oct 5 2010, 02:06 PM Post #6 | |
The master of cut retort Posts: 239 From: Warsaw, PL Joined: 21-July 10 | Okies, so I'm out - I have no knowlege about these things :/ |
Oct 5 2010, 04:26 PM Post #7 | |
Ameteur Member Posts: 48 Joined: 19-August 10 | Same as on sanny's forum. I posted that about month ago and still no answers :/ Nobody's research the camera as well. This post has been edited by Sweet: Oct 5 2010, 04:26 PM |
Oct 6 2010, 06:11 PM Post #8 | |
Coding like a Rockstar! Posts: 1,468 From: ??? Joined: 28-May 09 | You want the ASM for that opcode check, yes? Not so many ASM users here, I'm not so good with this either. You could make a call to CCamera__isSphereVisible (0x420D40), which is something like what I'd do in CLEO. It would be much easier for me to attempt to recreate an "are coordinates visible" function than an "is car visible" one... Here's an off-the-top attempt. This code will probably be mostly wrong, but it's better than nothing, I'd say. CODE function AreCoordsOnscreen(origin: float[3], fRadius: float): bool; // complete guess, probably wrong. { var dwFunc, dwThis: Integer; bReturn: Boolean; begin //dwThis := m_pInterface; // ??? m_pInterface should be a constant. It's value is probably needed. dwFunc := $420D40; // correct asm structure? asm push eax // don't know what this does //mov ecx, dwThis // no idea what it does or how it's involved, but it could be needed for this to work. mov eax, origin push fRadius push dword ptr [eax] push dword ptr [eax + 4] push dword ptr [eax + 8] call dwFunc mov bReturn, al end return bReturn; // replace with however you return from a function in Delphi - return the value of "bReturn". } The ASM is considerably basic, but I have no experience with Pascal or Delphi. It'd help to see some examples of working with SA functions/asm in it. I'm also wondering where you got that snippet from. It might help to see more of that, too. dwThis probably needs to refer to where the returned data should be directed to, but I'm not sure. Let me know if you get it working, I'm always interested in working with ASM -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
Oct 7 2010, 10:30 AM Post #9 | |
Ameteur Member Posts: 48 Joined: 19-August 10 | Its piece from SA sources, but not listener's. Its s0beit sources (or MTA, whatever). As Far As I Know its directly from CVehicle.cpp (in src folder). |