asteroid.type

Started by BeLugh, August 16, 2014, 03:21:32 PM

BeLugh

I have got some problems to use asteroid.type to differentiate between rocky, ice and lava for my mod.

Even when i use it step by step:

   asteroid = game.GetAsteroidDescriptionByID( args.target_id );
   var btype = asteroid.type;
   var atype = btype.toString();
   game.SendNotificationError(game.GetShipOwner(shipId), atype , "");

I do not get it to work. This makes the function or game crash (can't remember)
are you sure asteroid.type is an integer type and that it is really returned from that function?

I doubt asteroid.type is used in any other function, except in a a non-modable script, which spawns asteroids.

Otherwise i need another option to differentiate if a targetasteroid is rocky/ice or lava.
Do you have a hint for me please? :)

ai_enabled

Hello!
I just checked - it returns:
- int type
- int difficulty

BTW, looks like it's not too much info. Maybe we should include asteroid xml file ID?
Regards!

BeLugh

Xml file id would be great, then i could check if it contains rocky ice or lava to differ them :-)