AtomicTorch Studio Forums

VoidExpanse => Help section => Topic started by: BeLugh on August 16, 2014, 03:21:32 PM

Title: asteroid.type
Post by: BeLugh on August 16, 2014, 03:21:32 PM
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? :)
Title: Re: asteroid.type
Post by: ai_enabled on August 16, 2014, 10:27:38 PM
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!
Title: Re: asteroid.type
Post by: BeLugh on August 16, 2014, 10:35:19 PM
Xml file id would be great, then i could check if it contains rocky ice or lava to differ them :-)