Objects

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Objects

Post 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.
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: Objects

Post 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
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Objects

Post 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)
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: Objects

Post 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
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Objects

Post 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.
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: Objects

Post 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
Post Reply

Return to “Battle Academy : Modders Corner ”