aliens

Author Topic: [DONE][Suggestion] Negative events - Remove items from base  (Read 2624 times)

Offline mutantlord

  • Colonel
  • ****
  • Posts: 136
    • View Profile
[DONE][Suggestion] Negative events - Remove items from base
« on: September 06, 2022, 01:09:31 am »
Hello, I wish to propose a feature that remove items from base in Events. Something like.

events:
  - name: STR_NEGATIVE_EVENT
    description: STR_NEGATIVE_EVENT_DESCRIPTION1
    randomRemoveMultiItemList:
      -
        STR_AVALANCHE_LAUNCHER: 2
        STR_AVALANCHE_MISSILES: 10
      -
        STR_STINGRAY_LAUNCHER: 3
        STR_STINGRAY_MISSILES: 15
      -
        STR_CANNON: 4
        STR_CANNON_ROUNDS_X50: 20
    timer: 100
    timerRandom: 200
extraStrings:
   - type: en-US
     strings:
       STR_NEGATIVE_EVENT: "Base Theft"
       STR_NEGATIVE_EVENT_DESCRIPTION1: "Due to internal corruption in your base, some of your base items has been sold to the black markets."

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #1 on: August 17, 2024, 08:43:25 pm »
Done.

Any of the item generating attributes can be re-used.

Add attribute `invert: true` to make them remove items.

Example:

Code: [Select]
events:
  - name: STR_NEGATIVE_EVENT
    description: STR_NEGATIVE_EVENT_DESCRIPTION1
    invert: true   # default false
    randomMultiItemList:
      -
        STR_STINGRAY_LAUNCHER: 3
        STR_STINGRAY_MISSILES: 15
      -
        STR_PISTOL: 4
        STR_PISTOL_CLIP: 20
    timer: 100
    timerRandom: 200

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #2 on: August 17, 2024, 10:14:38 pm »
Question: what will be, if base does not have proper item when event happens?

Offline psavola

  • Commander
  • *****
  • Posts: 835
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #3 on: August 17, 2024, 10:37:27 pm »
Question: what will be, if base does not have proper item when event happens?

The code iterates through the bases, including crafts that are not out of the base, and removes the items until the desired amount has been reached. Nothing happens if there are no items to remove.

I suppose this imposes some limitations how this can be used. The example in the original suggestion does not make sense, because displaying a message about base theft makes little sense if nothing is in fact stolen.
« Last Edit: August 17, 2024, 10:46:29 pm by psavola »

Online Delian

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #4 on: August 17, 2024, 11:38:24 pm »
Logically, the event should only pop up if all the required items are present.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #5 on: August 18, 2024, 08:58:04 am »
Logically, the event should only pop up if all the required items are present.

If you want an event, where the thieves steal all your gold, what do you specify?
10, 100, 1000?
And if you specify 1000 gold, but there is only 999 gold in the base... do the thieves just say "yeah, f it, 999 gold is not worth our trouble, let's politely return it back and leave..."?


Anyway, the so called "negative events" have been discussed multiple times before and the result was, they are simply a bad feature overall.
They can't be properly specified... thus this discussion.
And they are a BAD game design anyway.
Most players (including myself) will just reload previous autosave and sell all gold before the thieves can steal it.


But sometimes I have a weak day and implement also features I completely disagree with.
« Last Edit: August 18, 2024, 08:59:49 am by Meridian »

Offline mutantlord

  • Colonel
  • ****
  • Posts: 136
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #6 on: August 18, 2024, 10:30:05 am »
Hi Meridian, thank you for implementing this feature. I look forward in including it in my mods. I remember in event script there is item trigger, this negative event can only trigger if the item is in the base. Can be use in a number of situations if a modder has the creative imagination for its use.  I am really grateful for it’s inclusion, thank you very much and your time in making it possible.

Online Delian

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #7 on: August 18, 2024, 11:38:19 am »
If you want an event, where the thieves steal all your gold, what do you specify?

I guess for negative events to properly function, they should be a lot more configurable, perhaps by allowing the modder to specify multiple outcomes:
What happens if no items present (below minimum range of required items): No message (event skipped), or failure message (take nothing)
What happens if some of the items are present: no message (event skipped), failure message (take nothing), partial success message (take whatever you can)
What happens if all of the items are present: success message (take all)

And who said that negative events have to only remove items? They could both take items and give items at the same time. Or crafts?

Hmm. This is pretty complicated, because conditions are normally only checked in eventScripts, which are only executed at the beginning of the month, but here we'd need to check conditions when an event happens during a month. So basically, when event happens, it would have to instantly trigger an eventScript, which would check the item conditions and conditionally trigger negative events depending on item presence and item count...
« Last Edit: August 18, 2024, 01:24:42 pm by Delian »

Offline mutantlord

  • Colonel
  • ****
  • Posts: 136
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #8 on: August 18, 2024, 04:01:57 pm »
Sample Coding
Code: [Select]
extraStrings:
   - type: en-US
     strings:
       STR_DCFEVENTS: "Disconnected Future Events"
       STR_EVENT39: "Base Corruption Detected"    
       STR_EVENT39NOTE: "One of our Logistic officers has found some inventory is missing from their regular base inventory check out. Their research is saying that some of these equipment is either missing, lost or stolen."

eventScripts:
  - type: STR_DCFEVENTS39
    eventWeights:
      0:
        STR_EVENT39: 100
    firstMonth: 0
    executionOdds: 1
    itemTriggers:
       STR_STRELA_LAUNCHER: true
events:
  - name: STR_EVENT39
    description: STR_EVENT1NOTE
    background: BACK13.SCR
    regionList: [LANDSPAWNSMERC]
    city: false
    points: 100
    invert: true
    randomMultiItemList:
      -
        STR_STRELA_LAUNCHER: 1
      -
        STR_STRELA_LAUNCHER: 2
      -
        STR_STRELA_LAUNCHER: 3
    timer: 25000
    timerRandom: 3000

Offline mutantlord

  • Colonel
  • ****
  • Posts: 136
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #9 on: August 18, 2024, 04:03:53 pm »
That is how it should work. Nothing more or less. Modder will have to come up with inspiration to work with the limits of this feature. Nothing more is ask of it.

Offline Osobist

  • Sergeant
  • **
  • Posts: 36
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #10 on: August 18, 2024, 06:36:13 pm »
A suggestion to improve this feature. When items are removed, add "-" symbol into popup window with output, e.g. -1 STR_PISTOL CLIP.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #11 on: August 19, 2024, 02:10:23 pm »
A suggestion to improve this feature. When items are removed, add "-" symbol into popup window with output, e.g. -1 STR_PISTOL CLIP.

Done.

Offline mutantlord

  • Colonel
  • ****
  • Posts: 136
    • View Profile
Re: [DONE][Suggestion] Negative events - Remove items from base
« Reply #12 on: August 19, 2024, 03:44:09 pm »
Well, at least I am glad that this feature is interested by a few other modders, not just me. Hope it can be expanded into something more with more suggestions.