IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Opcode 02DD

 How to use it?
 
GTA-Roloboy  
Posted: Monday, Aug 6 2012, 10:52
Quote Post


Player Hater
Group Icon
Group: Members
Joined: May 1, 2007

XXXXX



Hey,
I am using a SCM hook written in C++ and I am not sure how to use the opcode 02DD (get_random_actor) in Vice City
http://www.gtamodding.com/index.php?title=02DD

I tried several ways such as:
CODE

DWORD* pFoundActor = NULL;
ScriptCommand(&get_random_actor, "VICE_C", 1, 1, 1, &pFoundActor);

SCRIPT_WAIT(100);

ScriptCommand(&set_actor_bleeding, pFoundActor, 1);


but the game seems to crash when using it.

Help is appreciated, thanks smile.gif

This post has been edited by GTA-Roloboy on Wednesday, Aug 22 2012, 22:10
PM
  Top
 

 
krasiejow  
Posted: Monday, Aug 6 2012, 18:57
Quote Post


VC:MP betatester
Group Icon
Group: Members
Joined: May 15, 2008

XXXXX



Hey, are you Roloboy from VCMP?

Check if the script found the random actor. I found in my old scm script:

CODE
02DD: $6711 = get_random_ped_in_zone 'VICE_C' with_pedtype_civilian 1 gang 1 criminal/prostitute 1
if not $6711 == -1
jf @LabelC //back
01C9: actor 10@ kill_actor $6711
Users WebsitePM
  Top
 

 
spaceeinstein  
Posted: Monday, Aug 6 2012, 23:51
Quote Post


巧克力
Group Icon
Group: Members
Joined: Jul 17, 2003

cn.gif

Member Award




Make sure your actor actually exists if you want to perform an action on it. You can do that by checking if the variable is not -1 after using that opcode.
Users WebsitePM
  Top
 

 
GTA-Roloboy  
Posted: Wednesday, Aug 8 2012, 11:54
Quote Post


Player Hater
Group Icon
Group: Members
Joined: May 1, 2007

XXXXX



QUOTE (spaceeinstein @ Monday, Aug 6 2012, 23:51)
Make sure your actor actually exists if you want to perform an action on it. You can do that by checking if the variable is not -1 after using that opcode.

That would mean I'd have to use an integer instead of dword? Anyway that didn't do the trick..
PM
  Top
 

 
Link2012  
Posted: Wednesday, Aug 8 2012, 15:11
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



You can check if a DWORD is -1, compiler will accept and in reality will check if the DWORD is 4294967295.
PMMSN
  Top
 

 
GTA-Roloboy  
Posted: Wednesday, Aug 8 2012, 21:15
Quote Post


Player Hater
Group Icon
Group: Members
Joined: May 1, 2007

XXXXX



QUOTE (Link2012 @ Wednesday, Aug 8 2012, 15:11)
You can check if a DWORD is -1, compiler will accept and in reality will check if the DWORD is 4294967295.

I just debugged it and the value it returns is -1, tho I am creating the actor myself so I wonder why it doesn't find it?

CODE

ScriptActor* pActor = NULL;
ScriptActor* pActor2 = NULL;

pActor = new ScriptActor(pMission);
pActor->Spawn(1, 4,  -1017.0488f, 200.2007f, 11.2556f); //81.9790f

ScriptCommand(&get_random_actor, "VICE_C", 1, 1, 1, &pActor2);
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG