Product Chat / [SOLVED] BUG! Object ID

Author
Message
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 17th May 2019 19:35
BUG!
For one thing, every time you click on properties for an object,
the number to that object changes (pretty sure even if you
don't change any properties to it...)
Also, I have restarted GG, started a new map, and placed down a single
object now 3 times, and GG says Run Time Error! object not found
70011. But before testing, I verified very closely that the object matched
the script (the script calls for object number.)

The editor said the object was 70001, ((With only ONE object placed)),
but Run Time Error still showed a number 70011 from a previous test
map is not found.

Whoas up? Is this a windows glitch or .... ? hmmmm

The author of this post has marked a post as an answer.

Go to answer
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 17th May 2019 20:13
Well now, I'm looking at an older map from
a couple month ago, just to check this out,
so those objects don't seem to be reacting
the same way to "properties" clicks.

Anyone else have various results?
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 17th May 2019 20:18
I think you are using the object number instead of the e number in your script.

Object numbers and e entity numbers are different though related.

Cheers.
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 17th May 2019 20:27 Edited at: 17th May 2019 20:33
This is how im seeing it … Entity ID Number / Object Number ( 2 ) never changes
Last item selected or edited does but the ID Number always remains the same.
So it does not appear to be a bug. I think your confusing the numbers ?

The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 17th May 2019 20:52 Edited at: 17th May 2019 20:56
I always found it easier to have the entities self assign their own index number, in LUA by creating your own variable(s). So you can create a simple unique index chart that will allow for your scripts to work on any map and for anyone else too. No conflicts and no dependency on the map info.
Youtube - Teabone3 | Store Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 17th May 2019 22:25
So, is there anyway when we change the scale of
an object, to have the collision box also change
to correspond to the new scale?
PM
AmenMoses
GameGuru Master
8
Years of Service
Recently Online
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 17th May 2019 22:28
This post has been marked by the post author as the answer.
Simple solution, don't use hard wired ids in scripts!

g_Entity[ e ].obj gives you the objectID for entity id 'e', the script attached to an entity is *always* passed the entity id when it is called but GG allocates both ids so you have no control over them!

In general each time you open a map the ids will be the same as they were when you saved it but the same cannot be said if you edit the map, then the next time you open it they may very well be different.
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 17th May 2019 22:34
Syncromesh; Thanks for response. I do hope it's not common
for them to change like I saw it. Was strange honestly.
Definitely they where changing on this particular map.
But why I don't know. So I will keep an eye out for it.
Another map did not really pose the same experience.

Teabone; I think I get your drift, but I would need an example
to really follow you!

Anyhow guys, is there a way for the script to call for g_ObjectId?
That would be great, that and collision box scale becoming
equal to object when script does ScaleObject.
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 17th May 2019 22:36
AmenMoses-- haha, just in time (I'm late!)
now I see that. Thanks, will test it out!
PM
AmenMoses
GameGuru Master
8
Years of Service
Recently Online
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 17th May 2019 23:24
Be aware that if you use the scaling Lua functions the collision box is not recalculated, so only use them for non-physics entities, i.e. like decals.

This is due to the fact that physics stuff is all only done once when the level is started so the AI collision stuff works! (AI collision doesn't work with dynamic entities!).
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 18th May 2019 00:24 Edited at: 18th May 2019 02:43
Okay. Big bummer. Also, for some reason a script won't let me bury
crates into the ground (SetPosition) below ground... any ideas?

I guess I can still destroy entity, but the effect of boxes from above
won't be.
I tried physics off, is immobile, etc.
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 18th May 2019 01:18 Edited at: 18th May 2019 01:21
Quote: "Anyhow guys, is there a way for the script to call for g_ObjectId?"

Work with item name instead of item id, after all item name never change.

In the video I've 2 barrels, green barrel trigger the script and the blue store their name in a global var.
Green barrel destroy the blue one when player press E key.

If you want to try, just attach scripts as follow:

Attach this one to green barrel or whatever you want to trigger



And this one to the blue barrel



It works for me as you can see in the video below



hth
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 18th May 2019 02:42
Awesome! 3com.
PM

Login to post a reply

Server time is: 2024-04-19 09:21:27
Your offset time is: 2024-04-19 09:21:27