Author Topic: asteroid.type  (Read 1100 times)

BeLugh

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
asteroid.type
« 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.GetAsteroidDescriptionBy ID( 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

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1041
    • View Profile
Re: asteroid.type
« Reply #1 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!

BeLugh

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: asteroid.type
« Reply #2 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 :-)