Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Thing Numeration (create/destroything)
Thing Numeration (create/destroything)
2004-11-17, 4:43 PM #1
Hello everyone,

When I create a thing through cogscript, I'm assuming that if I have 300 things defined in JED and let's say 20 system things like projectiles, players, bubbles, etc, it will give me thing 321 and not 301?

Also, if I destroy thing 250, will it assign thing 301 or 250 to the next thing I create? If I destroy the first 100 things, and add 100 things later, will it go to 400 for the thing numbers? Will this alter the thingcount or affect the thinglimit?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-11-17, 5:28 PM #2
A thing's thingnumber never changes, keep that in mind.


1) When you create a thing ingame, it claims the first available thing number.
2) If youve got 300 objects, and you destroy thing #200, then the next one created will assume #200.
And when the moment is right, I'm gonna fly a kite.
2004-11-17, 5:40 PM #3
(I am assuming the 'it' is the JK engine.)

Answer to all questions except the last one:
The engine will give an unused thing number. It is best not to rely on the numbering algorithm because we don't know for sure what algorithm JK is using. (For instance, I thought JK always used the next number in sequence, which is contrary to what gbk just said. It has been awhile since I paid attention to the thing numbers, so I could be wrong.)

Answer to last question:
All create/destroy verbs affect the thing count. The create verbs can not create a thing if the thing count has reached the thing limit.

:)
2004-11-17, 6:33 PM #4
When dealing with Grismath, 'it' is always MotS.
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2004-11-17, 6:41 PM #5
Oh, yeah. Good point, jEDIkIRBY.

Um, MotS is probably the same way? :o

:)
2004-11-18, 1:22 PM #6
Double post.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-11-18, 1:22 PM #7
Quote:
Originally posted by ZeqMacaw

All create/destroy verbs affect the thing count. The create verbs can not create a thing if the thing count has reached the thing limit.


Perhaps you didn't understand my example.

Let's say you have n1 things, and let's assign that a value of 200. You now delete the first 100 things (0-99)*, leaving 100-199 remaining, n2. You then create 200 more things.

According to GBK, the first 100 of these new things would fill slots 0-99, so would the next 100 fill 199-299? I am assuming yes.

Otherwise, if I added 200 things to n2, even though only 300 things would exist, the engine might think, because the 200 new things would have taken slots 199-399, that I have exceeded the thing limit.

GBK's answer makes the most sense, so I'll work off of that. Thank you.

* Whether the walkplayer or whatever has been deleted is immaterial for the purposes of this example.

And jEDIkIRBY is very right about MotS, but I think that the specific engine is immaterial because I doubt that something so fundamental to the code would have been changed between builds of a very similar engine.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-11-18, 3:04 PM #8
I understood. :)

Just to clarify:
- Thing count means how many things are currently in-game (which includes those placed in the jkl and those created in-game via cog verbs).
- A create verb adds one to thing count (thus using a thing slot).
- A destroy verb subtracts one from thing count (thus making a slot unused).
- Thing count is always less than or equal to thing limit.

The numbering algorithm I alluded to would reuse the unused lower thing slots once the maximum numbered slot was reached.

I said the same thing as gbk (I was typing in my reply when he replied), except I answered Lord_Grismath's last question directly. I guess Lord_Grismath meant something else with his last question. ;)

:)

↑ Up to the top!