Author Topic: [Solved][Suggestion/Y-Scripts] setSpawnItem  (Read 1684 times)

Offline Buscher

  • Colonel
  • ****
  • Posts: 168
    • View Profile
[Solved][Suggestion/Y-Scripts] setSpawnItem
« on: February 17, 2023, 11:05:11 pm »
My latest plaything is trying to create some kind of flare launcher for HWPs.

Right now I added a grenade launcher to a HWP which is set up with spawnUnit to create a unit which is supposed to drop an electric flare. The unit is supposed to be insta-killed using the createUnit: hook and setting its health to 0. The game doesn't update the state of said unit from alive to dead. The state will be updated once another shot is taken or the turn is ended. I experimented with another bunch of options (skills which aren't available to units:, setSpawnUnit using inside the createUnit script and a few other things).

When talking about my fun experiences in Matrix, Yankes suggested that maybe this can be solved with setSpawnItem. A setSpawnItem next to setSpawnUnit would be really cool.

As always thank you for looking at the suggestion.
« Last Edit: April 23, 2023, 12:59:31 pm by Meridian »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: [Suggestion/Y-Scripts]setSpawnItem
« Reply #1 on: February 18, 2023, 02:08:20 am »
Correction, I suggest adding `spawnItem:` property, similar to current `spawnUnit:` in item, it will spawn item after explosion.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: [Suggestion/Y-Scripts]setSpawnItem
« Reply #2 on: February 18, 2023, 08:30:56 am »

Offline Buscher

  • Colonel
  • ****
  • Posts: 168
    • View Profile
Re: [Suggestion/Y-Scripts]setSpawnItem
« Reply #3 on: February 18, 2023, 09:53:20 am »
Thanks for the clarification and the link!