Forum

> > Stranded II > General > 'Invalid OBJECT ID for BUILDING (0)
Forums overviewStranded II overviewGeneral overviewLog in to reply

English 'Invalid OBJECT ID for BUILDING (0)

16 replies
To the start Previous 1 Next To the start

old 'Invalid OBJECT ID for BUILDING (0)

UnIdEnTiFiEd
User Off Offline

Quote
I keep getting this message when i start the game. ive been scripting and adding things and making them buildable. i know ive had this message before but i forgot how to fix it! please help!!!
edited 1×, last 03.10.10 06:30:30 am

old Re: 'Invalid OBJECT ID for BUILDING (0)

Psytechnic
User Off Offline

Quote
Be careful... When it comes to defining a building, you specify 2 IDs.

The first is the "id=" tag, and that has to be a unique ID for that building.

The second has to be a "objectid=" OR "unitid=". NOT BOTH! Just one. And the ID has to be an object or unit that currently is already defined in the scripts. This is what the "building" will turn into when you've put in all the materials to build whatever it is.

old Re: 'Invalid OBJECT ID for BUILDING (0)

Psytechnic
User Off Offline

Quote
Have you tried putting the mod through the latest version of my mod viewer? It might be able to tell you more about where the problem is.

But there's something unusual about that, because the error 'Invalid OBJECT ID for BUILDING (0)' means that in one building definition, you might not have either a "unitid=" or "objectid=", that's why it's reporting the value as (0). However, this could be in ANY building, not just in the one you were working on. I missed a "script=end" on a item and that messed up the item defined after it, so I spent ages looking at the other one instead of using my mod viewer and taking care of the errors it shows. After a while, I did and it worked.
edited 1×, last 03.10.10 08:03:19 am

old Re: 'Invalid OBJECT ID for BUILDING (0)

Psytechnic
User Off Offline

Quote
I hate it when that happens... I need as much information I can ge about how it crashed and where it crashed. You seem to be online now, so if you really want to get this solved quickly, upload a copy of your mod to filedropper or something and message me the link. I'll put it through the development build and find the error.

old Re: 'Invalid OBJECT ID for BUILDING (0)

DannyDeth
User Off Offline

Quote
Very simple answer to your code bloack over there. objectid is not neccisary! just use the id and the group, you don't need to specify objectid when you are making objects, take for instance this original SII script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
### Shelter
id=165
name=Shelter
group=building
icon=gfx\shelter01.bmp
model=gfx\shelter01.b3d
fx=16
health=100
mat=wood
behaviour=cover
script=start
	on:build_finish {
		event "shelterbuild",0,0;
	}
script=end
description=start
Offers cover for sleeping
description=end

Now where in hell do you see Objectid in there? You don't need to put that in thre and that is what is causing the error. See? Job done.

EDIT: Sorry that is incorrect because of how i read your code, the real problem is that the objectid needs to be below 255, otherwise it returns an error Sorry for that rant there |^|

old Re: 'Invalid OBJECT ID for BUILDING (0)

UnIdEnTiFiEd
User Off Offline

Quote
i believe you are mistaken for the object. not how to build the object.

btw phytechnic, i cant upload it because i would need permission because the base of the game is someone elses mod. im only adding my features to my own comfort.

if i did it would have to be private and you might have to delete file afterwards.

old Re: 'Invalid OBJECT ID for BUILDING (0)

Psytechnic
User Off Offline

Quote
UnIdEnTiFiEd has written
i believe you are mistaken for the object. not how to build the object.

btw phytechnic, i cant upload it because i would need permission because the base of the game is someone elses mod. im only adding my features to my own comfort.

if i did it would have to be private and you might have to delete file afterwards.


Could you ask the original author if I could use it purely for the improvement of the mod viewer, that would be fantastic. I would have no need to keep the mod because I'm not making one and have no intention to. My work here is clearly focused on the mod viewer and my free modelling.

@DannyDeth

That's not true. If you go into "game.inf", you will find three lines defining the maximum number of items, objects and units you can have. Items and objects can be set up to 5000, (0 based 4999), units can be set to 500.

old Re: 'Invalid OBJECT ID for BUILDING (0)

UnIdEnTiFiEd
User Off Offline

Quote
i believe the author hasnt been on for about.. 4 months but ill upload it for you anyway. just delete it afterwards (if you want)

check your messages for it

edit= @dannydeth i set it to 5000 and all my other objects are ok so really, it has nothing to do with that.

old Re: 'Invalid OBJECT ID for BUILDING (0)

DannyDeth
User Off Offline

Quote
? mine says this:
1
2
3
limit_objects=255
limit_units=100
limit_items=255
Lol, i didn;t know you could edit that until i seached the document, lol. Sorry about that. ( smartass fail on me )

old Re: 'Invalid OBJECT ID for BUILDING (0)

Ultr4killer
BANNED Off Offline

Quote
oh damn it. it is so easy. If you wont to know how to build more buildings here you go:

Go to your sys folder and find bulding you find for example this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
id=1
group=building
objectid=184
req=97
script=start
	unlockbuilding 4;
	unlockbuilding 5;
	unlockbuilding 6;
	unlockbuilding 7;
	unlockbuilding 9;
	unlockbuilding 28;
	unlockbuilding 29;
	unlockbuilding 36;
	unlockbuilding 38;
	unlockbuilding 39;
script=end

### Shelter
id=2
group=building
objectid=165
req=24,20
req=15,30
script=start
	unlockbuilding 4;
	unlockbuilding 5;
	unlockbuilding 6;
	unlockbuilding 7;
	unlockbuilding 9;
	unlockbuilding 28;
	unlockbuilding 29;
	unlockbuilding 34;
	unlockbuilding 36;
	unlockbuilding 38;
	unlockbuilding 39;
script=end


well lets mod the shelter there is the shelter just put there

unlock building and ID (the id is the nuimber next to unlock building)

so you put there for example: unlock building 8 than on building the shelter you can build well. The ID of buildings are at top of the list.


After makeing models or finding buildings or stuff what cant be builded you need go to editor find ID of the boject and put it in list, after that script oit on what do you need for building it othervise you get erros.

PS: to get the right id of the building just move the mouse over the icon of object and it should show you the ID of object after 3-4 seconds.

The id in the properties menu of object is incorect

old Re: 'Invalid OBJECT ID for BUILDING (0)

Hurri04
Super User Off Offline

Quote
UnIdEnTiFiEd has written
but i dont get whats wrong with this then

spoiler has written
### Lean-to
id=106
group=building
#objectid=4572
req=24,30
req=15,40
script=start
     unlockbuilding 8;
script=end

the fat marked line is where your error is. I wrote a # in front of it so this will be seen as a comment by the game but you should remove it completely to prevent confusions.

the objectid is only required in the buildings.inf file and it has to be the same ID you used for the object in the objects_*.inf file which in this case is 106.

old Re: 'Invalid OBJECT ID for BUILDING (0)

UnIdEnTiFiEd
User Off Offline

Quote
what? no im not talking about my survival stories mod. anyway problem resolved. (thanks to Psytechnic)
the problem was i added a 2 here objectid=4572
when it was ment to be 4576
To the start Previous 1 Next To the start
Log in to replyGeneral overviewStranded II overviewForums overview