Author Topic: Spawning a small unit from a big unit  (Read 3100 times)

Offline Cooper

  • Colonel
  • ****
  • Posts: 151
  • Chryssalids are awesome
    • View Profile
Spawning a small unit from a big unit
« on: December 03, 2022, 06:22:18 pm »
I'm using spawnUnit to spawn a 1x1 unit from a 2x2 unit. This gets a little buggy because of the size change. Is there any way to make the game less confused when spawning a small unit from a big?

Offline TBeholder

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Re: Spawning a small unit from a big unit
« Reply #1 on: December 31, 2022, 08:30:29 am »
Spawn an item that becomes an unit?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Spawning a small unit from a big unit
« Reply #2 on: December 31, 2022, 11:32:06 am »
Spawn an item that becomes an unit?

can you provide an example?

Offline TBeholder

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Re: Spawning a small unit from a big unit
« Reply #3 on: December 31, 2022, 04:34:15 pm »
I meant an item can spawn an unit when it “explodes” via spawnUnit, and a corpse can explode (Cyberdisk style)…
can you provide an example?
I tried to quickly test it, but could not even make a hovertank corpse explode like cyberdisk, so probably slowpoked somewhere, will try again with clearer head.  :-\
(Edit:) Got that one, the weird 0×0 corpseGeo thing and specab in 2 places.

Can’t get spawning to work with non-attack items, however.
There does not seem to be a way to change BattleType in scripts?
Hmm. If it’s a pre-set ability for non-player unit, maybe just place a grenade type item in the inventory, and set the fuse in newTurnItem script? So it’s dropped on death, then goes off after the turn ends. If the unit is immune to stun, of course, or it can be dropped while it’s alive.
« Last Edit: January 02, 2023, 06:30:47 pm by TBeholder »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Spawning a small unit from a big unit
« Reply #4 on: April 10, 2023, 06:10:24 pm »
I'm using spawnUnit to spawn a 1x1 unit from a 2x2 unit. This gets a little buggy because of the size change. Is there any way to make the game less confused when spawning a small unit from a big?

And what exactly is buggy?

I have tried spawning a 1x1 chryssalid from a 2x2 reaper and it worked quite well?
See attached video.

Code: [Select]
units:
  - type: STR_REAPER_TERRORIST
    spawnUnit: STR_CHRYSSALID_TERRORIST
« Last Edit: April 10, 2023, 06:12:20 pm by Meridian »

Offline Cooper

  • Colonel
  • ****
  • Posts: 151
  • Chryssalids are awesome
    • View Profile
Re: Spawning a small unit from a big unit
« Reply #5 on: January 15, 2024, 07:59:35 pm »
This is what happens to me. It does not seem to understand that it is not a 2x2 unit anymore.. This then confuses the 1x1 unit, and its not able to walk in certain directions.
« Last Edit: January 15, 2024, 08:01:35 pm by Cooper »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Spawning a small unit from a big unit
« Reply #6 on: January 17, 2024, 10:28:53 am »
Doesn't happen to me.

Can you give me a mod and a save where this happens?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Spawning a small unit from a big unit
« Reply #7 on: January 17, 2024, 10:27:45 pm »
Only now I have noticed you are using OXC.

I take my previous replies back then.
I have only tested with OXCE.

Offline Cooper

  • Colonel
  • ****
  • Posts: 151
  • Chryssalids are awesome
    • View Profile
Re: Spawning a small unit from a big unit
« Reply #8 on: January 20, 2024, 06:38:56 pm »
Hey!
Yes you are right. I have finally installed OXCE, and the bug is gone! So its an OXC issue.