Quantcast

Jump to content

» «
Photo

QUESTION: Single INST but multiple TOBJ entries

6 replies to this topic
Midnightz
  • Midnightz

    Populus vult decipi.

  • Members
  • Joined: 05 Feb 2007
  • United-States

#1

Posted 09 November 2012 - 04:53 PM

I have a single object that I'd like to use with multiple texture dictionaries at different times of day.
It seems that each TOBJ entry requires its own INST in order to load in-game.

In IPL file, I have:

CODE
inst
1248, bonus, 3, 2490.73, -1700.16, 1018.353, 0, 0, 0.382685577512, -0.92387864396, -1
end


In IDE file, I have:

CODE
tobj
1248, bonus, skin1, 150, 0, 6, 9
1248, bonus, skin2, 150, 0, 9, 12
end


If I've done this correctly, skin1 should load from 6am to 9am and skin2 should load from 9am to 12pm.
But only the first TOBJ entry appears in-game.
Can someone please explain to me why this doesn't work?
What is the purpose of requiring the name of a texture if you can't alternate between them?

Thanks in advance,
-Midnightz

DK22Pac
  • DK22Pac

    Playing SA on my lovely PS2. Y'all bums.

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine

#2

Posted 09 November 2012 - 05:10 PM

inst and tobj are different objects, they can't have same id.

Midnightz
  • Midnightz

    Populus vult decipi.

  • Members
  • Joined: 05 Feb 2007
  • United-States

#3

Posted 09 November 2012 - 05:40 PM

Yes they can. If I do this:

In IPL...

CODE
inst
1248, bonus, 3, 2490.73, -1700.16, 1018.353, 0, 0, 0.382685577512, -0.92387864396, -1
end



In IDE...

CODE
tobj
1248, bonus, skin1, 150, 0, 6, 9
end


...same ID works fine. But that doesn't allow me to use multiple texture dictionaries for one INST.

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#4

Posted 09 November 2012 - 06:28 PM

You don't understand the purpose of IDE and IPL files.
IDE declares objects, specifies something to certain ID. It can happen only once.

Object with specified ID is ready to use in game, in IPL files, by SCM script and whatever.

IPL - it places objects, objects must have been declared by IPL files earlier.
You can put something on map many times in different places.
Put it:

IPL:
CODE
inst
1248, bonus, 3, 2490.73, -1700.16, 1018.353, 0, 0, 0.382685577512, -0.92387864396, -1
1249, bonus, 3, 2490.73, -1700.16, 1018.353, 0, 0, 0.382685577512, -0.92387864396, -1
end


IDE:
CODE
tobj
1248, bonus, skin1, 150, 0, 6, 9
1249, bonus, skin2, 150, 0, 9, 12
end


Difference:

IDE files - declare objects on certain IDs, make them ready to use later
IPL files - use available objects that are declared and have IDs

Midnightz
  • Midnightz

    Populus vult decipi.

  • Members
  • Joined: 05 Feb 2007
  • United-States

#5

Posted 09 November 2012 - 07:35 PM

QUOTE (fastman92 @ Friday, Nov 9 2012, 14:28)
IDE declares objects, specifies something to certain ID. It can happen only once.

IDE files - declare objects on certain IDs, make them ready to use later

Yes I understand that much. What I am asking is: why can't it happen more than once? Each TOBJ line tells the game that between certain times, do this and at other times, do that. Therefore, it should only make one instance of TOBJ work at a time, no? This is what I am confused about.

Thanks,
-Midnightz

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#6

Posted 09 November 2012 - 08:04 PM Edited by fastman92, 09 November 2012 - 08:07 PM.

It's because of the way system of IDs is programmed in gta_sa.exe.
There are IDs
0 to 19999

And ID may be specified to only one object internally, it has no room for many objects per one ID, in memory pointer to one structure of object is being put.
Only one pointer per ID, no more.
Pointer in _modelPtrs array may be zero - then it's not used ID yet, free ID.

In example
CODE
tobj
1248, bonus, skin1, 150, 0, 6, 9
1248, bonus, skin2, 150, 0, 9, 12
end

In the second line 1248 model already points to structure consisting of data such as bonus, skin1, 150, 0, 6, 9
in binary form.

Therefore it can't be changed, 1248 would have to be replaced with new data: bonus, skin2, 150, 0, 9, 12
Thanks to crash it won't happen and you know that there's an error to be fixed.

Midnightz
  • Midnightz

    Populus vult decipi.

  • Members
  • Joined: 05 Feb 2007
  • United-States

#7

Posted 09 November 2012 - 08:19 PM

Interesting... my game doesn't error or crash, it just executes only 1 instance of the TOBJ lines. Must be that the EXE looks for object's instruction via TOBJ line only once and can not dynamically re-read that info again so the 2nd line simply gets skipped.

I think I understand now, thank you. smile.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users