Page 1 of 1
Objects
Posted: Mon Jul 23, 2012 10:31 am
by enric
Can I have some more info on the objects functions?.
exemple:
PlaceObject(1800, 1800, "french_objects", "PONTOON");
I get the Arnhem bridge placed.
but
PlaceObject(1800, 1800, "french_objects", "tree");
I get the tree.
but
PlaceObject(1800, 1800, "french_objects", "house");
Again the Arnhem bridge.
--
id = GetObjectFromName("", "TANK_TRAPS", 0) or
id = GetObjectFromName("", "TANK TRAPS", 0)
I get -1, even if there is an object of this class
--
objectSet: which are the values that define these sets?, "french_objects" seems not working.
Re: Objects
Posted: Thu Jul 26, 2012 4:54 pm
by pipfromslitherine
I am guessing that the files don't exist, and it falls back to placing the 'first' object in the list, which annoyingly is the bloody bridge

.
GetObjectFromName won't work without an object set. This is basically the folder name of the objects.
Cheers
Pip
Re: Objects
Posted: Thu Jul 26, 2012 5:36 pm
by enric
GetObjectFromName won't work without an object set. This is basically the folder name of the objects.
From BATTLESCRIPT.TXT
//return the id of the Nth object on the map of the described type.
If objectSet is an empty string then any object matching the objectName will be returned. Returns -1 if no more are found. Not case sensitive
GetObjectFromName(objectSet, objectName, index)
Re: Objects
Posted: Thu Jul 26, 2012 6:20 pm
by pipfromslitherine
Fair enough - my mistake. The name of the object is tanktraps though, so that would explain why you cannot find it.
Cheers
Pip
Re: Objects
Posted: Thu Jul 26, 2012 6:25 pm
by enric
Well the problem are in the names, is there a little confusion, the name showed in the tile is not the name of the object in the list where you choose the object, and either is not the name of the object in the folder objects...
Don't worry I'm getting used to.
Re: Objects
Posted: Thu Jul 26, 2012 6:33 pm
by pipfromslitherine
The name is the filename of the s4f for the object. I appreciate it is not obvious, as the objects file doesn't include all objects (so I can't use the chunk names) and the editor names are localised so I can't use them.
I will add as task to allow showing of the 'real' name in the editor for an object. Hmmm - thinking, if you hold down SHIFT it shows all the objects on a tile and I THINK it uses their 'real' names.
Cheers
Pip