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

 CLEO Script Crashing

 Caused by Opcode to Find Carmods
 
gtafan113  
Posted: Monday, Jun 11 2012, 22:54
Quote Post


Untitled
Group Icon
Group: Members
Joined: Mar 1, 2009

us.gif

XXXXX



When I try to check the carmods on a car with opcode 096D, it crashes with some cars. Seemingly the ones that cannot be modded or only have basic Modding options. I've tried making sure the car can be modded but that doesn't seem to work either. Here's the part of the code that checks if the car can be modded and then checks the mods if the car can be modded.

CODE

0006: 17@ = -1

:CARMOD_381
000A: 17@ += 1
8029:   not  17@ >= 19
004D: jf @CARMOD_478
06E5: get_car 2@ possible_to_built_in_component_pool_index 17@ itemID_to 18@
8039:   not  18@ == -1
004D: jf @CARMOD_381
0002: jump @CARMOD_590

:CARMOD_478
0006: 17@ = 0
0006: 18@ = 0
0006: 19@ = 0
0006: 20@ = 0
0006: 21@ = 0
0006: 22@ = 0
0006: 23@ = 0
0006: 24@ = 0
0006: 25@ = 0
0006: 26@ = 0
0006: 27@ = 0
0006: 28@ = 0
0006: 29@ = 0
0006: 30@ = 0
0006: 31@ = 0
0002: jump @CARMOD_740

:CARMOD_590
096D: get_car 2@ component_on_slot 0 model_to 17@
096D: get_car 2@ component_on_slot 1 model_to 18@
096D: get_car 2@ component_on_slot 2 model_to 19@
096D: get_car 2@ component_on_slot 3 model_to 20@
096D: get_car 2@ component_on_slot 4 model_to 21@
096D: get_car 2@ component_on_slot 5 model_to 22@
096D: get_car 2@ component_on_slot 6 model_to 23@
096D: get_car 2@ component_on_slot 7 model_to 24@
096D: get_car 2@ component_on_slot 8 model_to 25@
096D: get_car 2@ component_on_slot 9 model_to 26@
096D: get_car 2@ component_on_slot 10 model_to 27@
096D: get_car 2@ component_on_slot 12 model_to 28@
096D: get_car 2@ component_on_slot 13 model_to 29@
096D: get_car 2@ component_on_slot 14 model_to 30@
096D: get_car 2@ component_on_slot 15 model_to 31@

:CARMOD_740
rest of code


Is there any way to make this work?
PMAOLPlayStation Network
  Top
 

 
Link2012  
Posted: Tuesday, Jun 12 2012, 02:26
Quote Post


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

ba.gif

XXXXX



When I was doing things related to upgrade I noticed some cars with some upgrades returns incorrect values (nitro\hydraulic for example)

If this is your problem, here is what I've done to solve the problem:
CODE
06E5: get_car 2@ possible_to_built_in_component_pool_index 17@ itemID_to 18@
06E6: get_itemID 18@ destinated_component_slot_to 33@
if 33@ == 17@
then
// Yes, have upgrades in this slot
end
PMMSN
  Top
 

 
Deji  
Posted: Tuesday, Jun 12 2012, 07:48
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



You'd be most safe model checking, as the original SA car mod script does.
Users WebsitePM
  Top
 

 
Link2012  
Posted: Tuesday, Jun 12 2012, 11:49
Quote Post


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

ba.gif

XXXXX



Or even better, you can use the SCM Funcs here to work with a modded veh_mods.dat
PMMSN
  Top
 

 
gtafan113  
Posted: Tuesday, Jun 12 2012, 20:00
Quote Post


Untitled
Group Icon
Group: Members
Joined: Mar 1, 2009

us.gif

XXXXX



QUOTE (Deji @ Tuesday, Jun 12 2012, 03:48)
You'd be most safe model checking, as the original SA car mod script does.

Do you mean like checking the model of the car and then only read the mods that car can have? I did consider this I was just hoping there was a less tedious way.

Link I'll try taking a look at the scm thing and see if I can understand it enough to use it. Thank you for the other suggestion, it stopped the crash but I didn't get to finish testing it yet like on vehicles that can be modded.

EDIT: I got it working now as far as I can tell, thanks guys!

I was also wondering if it's possible to store the variation of a car to a variable. I know how to set the variation but I'm not sure how to check it.

This post has been edited by gtafan113 on Tuesday, Jun 12 2012, 23:01
PMAOLPlayStation Network
  Top
 

 
Deji  
Posted: Tuesday, Jun 12 2012, 23:03
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



Check the CARMODS script and see how R* did it. Coz thats likely the best way and you can just copy their code.
Users WebsitePM
  Top
 

 

1 User(s) are reading this topic (1 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