Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Creating an object with SCM


Revolution-Designes
 Share

Recommended Posts

Revolution-Designes

Hello everybod,

 

I'm having a (little) problem with creating/adding objects in the main.scm.

I'm currently developing a Total Conversion mod for GTA: San Andreas, i have almost completed a small city and i have currently 4 missions.

In the fourth mission someone is blowing up a bridge, so i have made 2 models of the bridge. A destroyed bridge model an a normal/repaired bridge.

 

First i have added my normal/repaired bridge to the IPL file of my mod:

 

5055, newbrug2, 0, -347.577, 128.117, 21.12, 0, 0, 0.707106, 0.707107, -1

 

It works perfectly and everything is fine.

Now i have deleted that line in the IPL and created this line in the object.dat file:

 

newbrug2  99999.999,  1000.0,  0.97,  0.05,  50.0,  201.0,  0.75,   1,	1,	0,  0,	2,	0.0, 0.0, 3.0,  none

 

I defined the object in the main.scm:

 

DEFINE OBJECTS 3DEFINE OBJECT SANNY BUILDER 3.04      DEFINE OBJECT BRIEFCASEDEFINE OBJECT NEWBRUG2

 

And created the model in the main.scm:

 

Model.Load(#NEWBRUG2)038B: load_requested_models and:MAIN_560wait 0 if and  Model.Available(#NEWBRUG2)else_jump @MAIN_560and0107: $91 = create_object #NEWBRUGCOL2 at -347.577, 128.117, 21.12

 

 

I have the exact same coordinates as in the IPL file but my model is 3 times higher in the air as it should be.

But that is not all, the draw distance of the model is very low, so i can only see it when i am near the model.

 

Does anybody knows how i can solve this problem?

 

Grtz RD dontgetit.gif

Edited by Revolution-Designes
Link to comment
Share on other sites

This line dont allow comma:

0107: $91 = create_object #NEWBRUGCOL2 at -347.577, 128.117, 21.12

should be:

 

0107: $91 = create_object #NEWBRUGCOL2 at -347.577 128.117 21.12

 

only classes can have comma

this version

 

$91 = Object.Create(#A51_JETDOOR, -347.577, 128.117, 21.12)

 

 

 

the draw distance of the model is very low, so i can only see it when i am near the model.

ask for that in the map section

Link to comment
Share on other sites

Revolution-Designes

Thanks for the reply's, the bridge is now at the good place.

But the only problem is the draw distance now, when i use the IPL to create the object the draw distance is normal and good.

But if i use a code in the main.scm, then is the draw distance very low.

 

Grtz RD

Link to comment
Share on other sites

gtasearcher
But the only problem is the draw distance now, when i use the IPL to create the object the draw distance is normal and good.

But if i use a code in the main.scm, then is the draw distance very low.

 

Grtz RD

I think you'll have to also create the LOD as an object standing in the same place.

Link to comment
Share on other sites

Revolution-Designes
But the only problem is the draw distance now, when i use the IPL to create the object the draw distance is normal and good.

But if i use a code in the main.scm, then is the draw distance very low.

 

Grtz RD

I think you'll have to also create the LOD as an object standing in the same place.

But the question is how? tounge.gif

Link to comment
Share on other sites

Dutchy3010

I don't know much about modelling, so that is a bit of a problem. Perhaps you can make a script that checks if the player is outside a certain radius, and if so, you delete the normal bridge and add the col version? Never tested this tough.

Link to comment
Share on other sites

This should be possible, as the same things happens in SA also.

e.g. when the crack factory in San Fiero is blown up, the model is also replaced, and this is a model with a LOD..

 

There are 4 models:

#CRACKFACT_SFS // The normal factory

#CF_EXT_DEM_SFS // The damaged factory

#LODCRACKFACT_SFS // the LOD of the normal factory

#LODEXT_DEM_SFS // the LOD of the damaged factory

 

The following pieces of code from the main.scm are accessing them

 

Initializing the normal objects:

 

0776: create_objects_in_object_group "CRACK" 0363: create_object_at -2166.86 -236.5 40.86 radius 40.0 model #CRACKFACT_SFS visibility 1 0363: create_object_at -2185.49 -215.55 34.31 radius 40.0 model #CF_EXT_DEM_SFS visibility 0 0363: create_object_at -2166.86 -236.5 40.86 radius 40.0 model #LODCRACKFACT_SFS visibility 1 0363: create_object_at -2185.49 -215.55 34.31 radius 40.0 model #LODEXT_DEM_SFS visibility 0 

 

 

Switching to damage objects:

 

0777: delete_objects_in_object_group "CRACK" 0363: create_object_at -2166.86 -236.5 40.86 radius 40.0 model #CRACKFACT_SFS visibility 0 0363: create_object_at -2185.49 -215.55 34.31 radius 40.0 model #CF_EXT_DEM_SFS visibility 1 0363: create_object_at -2166.86 -236.5 40.86 radius 40.0 model #LODCRACKFACT_SFS visibility 0 0363: create_object_at -2185.49 -215.55 34.31 radius 40.0 model #LODEXT_DEM_SFS visibility 1 

 

 

 

 

bS8xA.png
Link to comment
Share on other sites

Or replace the model of a map object like the cement hubhole of deconstruction

 

03B6: replace_model_at -2049.171 250.3193 34.477 radius 20.0 from #HUBHOLE1_SFSE to #HUBHOLE2_SFSE

 

I had tested with SF garage

 

03B6: replace_model_at -2049.171 250.3193 34.477 radius 20.0 from #OLDGARAGE_SFS to #MISSION_08_SFS

 

needs to insert the exact coords of the mapobject and if the model dont fits you get holes in the col

Link to comment
Share on other sites

james227uk

I had tested with SF garage

 

03B6: replace_model_at -2049.171 250.3193 34.477 radius 20.0 from #OLDGARAGE_SFS to #MISSION_08_SFS

 

needs to insert the exact coords of the mapobject and if the model dont fits you get holes in the col

What change does that make? I can't remember

Link to comment
Share on other sites

 

I had tested with SF garage

 

03B6: replace_model_at -2049.171 250.3193 34.477 radius 20.0 from #OLDGARAGE_SFS to #MISSION_08_SFS

 

needs to insert the exact coords of the mapobject and if the model dont fits you get holes in the col

What change does that make? I can't remember

#OLDGARAGE_SFS was not changed in the story. Its a test to see whats possible

it replace Doherty garage with an other building

Link to comment
Share on other sites

james227uk

I had tested with SF garage

 

03B6: replace_model_at -2049.171 250.3193 34.477 radius 20.0 from #OLDGARAGE_SFS to #MISSION_08_SFS

 

needs to insert the exact coords of the mapobject and if the model dont fits you get holes in the col

What change does that make? I can't remember

#OLDGARAGE_SFS was not changed in the story. Its a test to see whats possible

it replace Doherty garage with an other building

Ok. Cool.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.