aliens

Author Topic: [DONE][Suggestion] Ability for geoscape events to spawn craft  (Read 2194 times)

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 685
    • View Profile
Research can give several items, is it possible to give a craft? I know it can spawn events but those also only give items and not craft´s. This will help since sometimes we want to give craft´s  and need to create an item then make players manufacture it, to transform it into a craft.

Offline Yankes

  • Commander
  • *****
  • Posts: 3329
    • View Profile
Re: [Suggestion] Spawn Craft on Research
« Reply #1 on: March 31, 2023, 02:05:56 pm »
What if you do not have room for craft in base?

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 685
    • View Profile
Re: [Suggestion] Spawn Craft on Research
« Reply #2 on: April 01, 2023, 03:52:44 pm »
Well a pop up, no space in base for new craft, and a refund of the cost sell, thats the ideal . if not possible , nothing happens and no craft arrives

Offline Finnik

  • Commander
  • *****
  • Posts: 507
  • Finnik#0257
    • View Profile
Re: [Suggestion] Spawn Craft on Research
« Reply #3 on: April 02, 2023, 12:08:51 pm »
Well, if I understand how states works in OXC, it could be a problem. All event logic is processed after event popup window was opened. I'm not sure, but I think it is impossible with current solution to "suppress" event window popup if it fails it's game logic and should not be opened - even if we close it with code, it still will have some visible animations.
Because of that my initial solution was to put all event processing logic into event save game entity (like, say, alien missions work), not to state - its logic would decide, if we even need a state, or the event would be hidden.
Btw, this is not the only case - in my project I need some events to be processed with the game without noticing the player, like toggling some researches-triggers for campaign. Although, arc scripts could help, but they are processed monthly, thus not very agile to me.
Also, that would help with removing item from the base. Like something happened with alien artifact you found in UFO crash site if the player would not research it ASAP. Adding logic to interrupt the event if we don't have the required item in any of our bases before window popup would help to solve the problem.

Not like I'm arguing here to make some changes, as I can do that for my fork personally; just wanted to know what do you guys think about it, AFAIK some other modders would also like to have such feature.

Offline Osobist

  • Sergeant
  • **
  • Posts: 36
    • View Profile
Re: [Suggestion] Spawn Craft on Research
« Reply #4 on: April 03, 2023, 07:56:43 pm »
Hiding events from player would be a nice feature, not to mention removing items from bases. That would allow to implement, for example, events with escaped prisoners.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Re: [DONE][Suggestion] Ability for geoscape events to spawn craft
« Reply #5 on: January 14, 2024, 08:35:02 pm »
Research can give several items, is it possible to give a craft? I know it can spawn events but those also only give items and not craft´s. This will help since sometimes we want to give craft´s  and need to create an item then make players manufacture it, to transform it into a craft.

Added for events.
I don't want to add it on two places, please use events instead of research directly.

https://github.com/MeridianOXC/OpenXcom/commit/8ea838ef501113e29953bc0b5e372c2b52c39b94

Test build: https://lxnt.wtf/oxem/builds//Extended/Extended-7.11.1-fdcd1a075-2024-01-14-win64.7z

Code: [Select]
research:
  - name: STR_LASER_WEAPONS
    spawnedEvent: STR_SEND_AVENGER

events:
  - name: STR_SEND_AVENGER
    description: STR_INFORM_PLAYER
    timer: 60
    spawnedCraftType: STR_AVENGER
    spawnedPersons: 1000
    spawnedPersonType: STR_ENGINEER

What if you do not have room for craft in base?

Well a pop up, no space in base for new craft, and a refund of the cost sell, thats the ideal . if not possible , nothing happens and no craft arrives

Currently events don't check for available space.
You can summon 1000 engineers too if you want for example.

Popup/refund/sell/transfer/other will be implemented together with Hangar Types feature... I skip it now as I would have to redo it later anyway.