Author Topic: [UNIT] Drone Carrier Tank  (Read 9917 times)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [UNIT] Drone Carrier Tank
« Reply #15 on: October 14, 2020, 09:23:33 pm »
This is trivial, you need two tags, one on weapon that enable this behavior, and another in armor that allow to choose correct target,
then in damage script add something like this (this is not correct script only idea):
Code: [Select]
weapon.getTag a Tag.NEED_SPECIAL_TARGET;
unit.getTag u Teg.SPECIAL_TARGET;
if neq a 0;
  if neq a u;
    set power 0;
  end;
end;
This make that if weapon have set tag `NEED_SPECIAL_TARGET` then it only can "damage" armor that have setted `SPECIAL_TARGET` with same value.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: [UNIT] Drone Carrier Tank
« Reply #16 on: October 15, 2020, 11:32:30 am »
This is trivial, you need two tags, one on weapon that enable this behavior, and another in armor that allow to choose correct target,
then in damage script add something like this (this is not correct script only idea):
Code: [Select]
weapon.getTag a Tag.NEED_SPECIAL_TARGET;
unit.getTag u Teg.SPECIAL_TARGET;
if neq a 0;
  if neq a u;
    set power 0;
  end;
end;
This make that if weapon have set tag `NEED_SPECIAL_TARGET` then it only can "damage" armor that have setted `SPECIAL_TARGET` with same value.

This looks like it will be very useful, thank you for sharing your code Yankes.

Much more efficient than using up one of the specilized damageType: and having to configure it for all units and weapons involved.

(I could be wrong as I am still very unfamiliar with the syntax of scripting, but I think there may be a typo on line 2. Should Teg.SPECIAL_TARGET instead be Tag.SPECIAL_TARGET?)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [UNIT] Drone Carrier Tank
« Reply #17 on: October 15, 2020, 04:54:22 pm »
This was only draft, and have omissions and bugs, and yes correct is `Tag`.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11731
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [UNIT] Drone Carrier Tank
« Reply #18 on: October 15, 2020, 05:15:16 pm »
Thanks, I'll have a look when I have some free time!

If someone else wants to give it a try and introduce this feature in XCF, I would be interested in merging it.

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: [UNIT] Drone Carrier Tank
« Reply #19 on: October 15, 2020, 10:51:47 pm »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11731
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [UNIT] Drone Carrier Tank
« Reply #20 on: October 16, 2020, 12:27:14 pm »

Offline Alex_D

  • Colonel
  • ****
  • Posts: 498
    • View Profile
Re: [UNIT] Drone Carrier Tank
« Reply #21 on: October 21, 2020, 06:59:35 am »
Version 1.1 of the submod.

A new unit has been added. A very  alien-looking Hovertank Carrier.
A new drone unit has been added: A flying attack drone.

All art based on a certain game that starts with Star and end with Craft.

Comments are appreciated.

EDIT: Code optimized. No other change. Thanks to Meridian for the tips.
« Last Edit: October 22, 2020, 01:54:14 am by Alex_D »