aliens

Author Topic: unlockedResearch, startDelay, enemies ignore civilians, throwing, surrender  (Read 4267 times)

Offline tkzv

  • Commander
  • *****
  • Posts: 583
    • View Profile
EDIT by Meridian: for future readers, questions are about OXCE, even though the thread is in OpenXcom section

1. I want to display a Ufopaedia page after a successful mission. I wanted to use alienDeployments...unlockedResearch, but these posts: https://openxcom.org/forum/index.php/topic,4187.msg79243.html#msg79243 https://openxcom.org/forum/index.php/topic,5227.msg78149.html#msg78149 say it won't work. Does it still not work? If no, will creating a mission victory slideshow work?

2. Is there a limit to missionScripts...startDelay ? What happens if the conditions for researchTriggers change, for times over 1 month? For example, startDelay is 100 000 (over 2 months) and researchTriggers has STR_THE_MARTIAN_SOLUTION: false, but I discover STR_THE_MARTIAN_SOLUTION in the meantime. Does the mission execute 2 months later or not?

3. I want to make a mission about chasing an enemy in a crowd of bystanders. Is it possible to create a mission where enemies don't deliberately shoot civilians? (Collateral damage is fine, but the enemy only targets X-COM, it shouldn't be distracted.)
By the way, how do I set civilians' aggressiveness toward the enemy?

4. Did anybody ever make collapsible weapons? What I mean: an object in backpack has 1x2 size, when placed in hand it changes the sprite and becomes 2x3, when placed to backpack it becomes 1x2 again. Or, at the very least, it stays 1x2, but its sprite changes when in hand. Do scripts allow anything like that?

5. Is it possible to inflict damage with all thrown objects? For example, throw an empty gun at an enemy and remove several hit points? If this would require rewriting each object as a weapon, can it be done with guns too?

6. How is energy consumption calculated? How to set actions different from the formula Energy Used = INT( TUs_Used / 2^X ) where X = 0, 1, 2, 3, 4... ? I want to create a unit that would throw grenades with great range and precision, but at the cost of energy.

7. Is it possible to create a unit that surrenders at the end of the 1st turn?


And the questions I forgot:
8. Is it possible to make a two-step research: where the after-mission report is short and partially incorrect, and further investigation in the lab replaces it with the correct one?

9. Some terrain tiles explode, when hit by bullets, some catch fire, some do neither. Where to set it?

10. Timed missions: turnLimit and chronoTrigger. What can happen with the loot when turns run out, but both sides are still alive, conscious and can fight? Do enemies surrender if ChronoTrigger = 2? I want to keep the corpses and stunned ones and their possessions, but lose the ones, who escape quickly enough, and their possessions. So that a player can choose to risk for a large gain or just wait it out for zero gain.
« Last Edit: November 02, 2018, 01:50:23 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
1. not possible to open pedia; slideshow will work

2. there is no limit to startdelay; the alien mission starts at day 0 (and is not re-evaluated next month or anything)... just the first UFO / first mission site will be delayed to 2 months later

3. enemies shoot civilians, civilians shoot enemies (if they have weapons), no parameters

4. scripts can probably do it... they can definitely change weapon sprites, I just don't know what parameters can be used... but name of the slot weapon is in sounds like a reasonable parameter to expect; they cannot change the weapon's inventory size though, only visually the sprite

5. thrown stuff does not inflict damage

6. uhm, hardcoded for moving... for shooting/throwing can be defined as flat cost or % cost

7. yes, in many ways... easiest probably to use the autoSurrender flag, if you just have this one unit in the field

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
1. not possible to open pedia; slideshow will work

unlockedResearch gives the research listed but doesn't open the corresponding UFOPedia page?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
unlockedResearch gives the research listed but doesn't open the corresponding UFOPedia page?

correct, atm

Offline tkzv

  • Commander
  • *****
  • Posts: 583
    • View Profile
1. not possible to open pedia; slideshow will work

2. there is no limit to startdelay; the alien mission starts at day 0 (and is not re-evaluated next month or anything)... just the first UFO / first mission site will be delayed to 2 months later

3. enemies shoot civilians, civilians shoot enemies (if they have weapons), no parameters

5. thrown stuff does not inflict damage
I still hoped to be wrong...

4. scripts can probably do it... they can definitely change weapon sprites, I just don't know what parameters can be used... but name of the slot weapon is in sounds like a reasonable parameter to expect; they cannot change the weapon's inventory size though, only visually the sprite
Big sprite in either hand, small sprite everywhere else, size always the same. That'll do, thanks.


6. uhm, hardcoded for moving... for shooting/throwing can be defined as flat cost or % cost
Where to define it? In the grenade properties? And what about the range? Only by setting strength?

7. yes, in many ways... easiest probably to use the autoSurrender flag, if you just have this one unit in the field
That simple? Thanks.

And the questions I forgot:
8. Is it possible to make a two-step research: where the after-mission report is short and partially incorrect, and further investigation in the lab replaces it with the correct one?

9. Some terrain tiles explode, when hit by bullets, some catch fire, some do neither. Where to set it?

10. Timed missions: turnLimit and chronoTrigger. What can happen with the loot when turns run out, but both sides are still alive, conscious and can fight? Do enemies surrender if ChronoTrigger = 2? I want to keep the corpses and stunned ones and their possessions, but lose the ones, who escape quickly enough, and their possessions. So that a player can choose to risk for a large gain or just wait it out for zero gain.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Where to define it? In the grenade properties? And what about the range? Only by setting strength?

each action (auto, snap, melee, aimed, throw, panic, mindcontrol, use, etc.) can have different cost... defined in different attributes... best to look into existing mods (e.g. piratez), or stats for nerds screen with defaults button turned on.

Small sample:

Code: [Select]
items:
  - type: STR_VIBRO_BLADE
    costMelee:
      time: 16
      energy: 8

Throwing range only by strength.

8. I already said there is no after mission pedia report... or do you mean something else?

9. don't know... maybe hobbes can help with explosions...

10. just test it? probably quicker than looking it up in the code...

EDIT: for enemies surrendering, use chronotrigger 3: https://github.com/MeridianOXC/OpenXcom/commit/1399ef1a49958909fa5bd002fa00b98469630a48
« Last Edit: November 02, 2018, 03:38:03 pm by Meridian »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
9. Some terrain tiles explode, when hit by bullets, some catch fire, some do neither. Where to set it?

Byte 55 of MCD entry defines the explosion strength, byte 54 sets the explosion type (HE, smoke, IN or stun)
« Last Edit: November 02, 2018, 04:19:12 pm by Hobbes »

Offline tkzv

  • Commander
  • *****
  • Posts: 583
    • View Profile
each action (auto, snap, melee, aimed, throw, panic, mindcontrol, use, etc.) can have different cost... defined in different attributes... best to look into existing mods (e.g. piratez), or stats for nerds screen with defaults button turned on.

Small sample:

Code: [Select]
items:
  - type: STR_VIBRO_BLADE
    costMelee:
      time: 16
      energy: 8

Throwing range only by strength.
Thanks, missed that part.

8. I already said there is no after mission pedia report... or do you mean something else?
Something else, although related. The mission gives a piece of research with incomplete and partially incorrect information. (Regardless of how and where it appears.) A player can later conduct research, that gives results contradicting the first report. It would make sense to remove the first report from Ufopaedia when the 2nd is finished. Is it possible?


10. just test it? probably quicker than looking it up in the code...

EDIT: for enemies surrendering, use chronotrigger 3: https://github.com/MeridianOXC/OpenXcom/commit/1399ef1a49958909fa5bd002fa00b98469630a48
Thanks, I woudn't have thought to try numbers above 2. Not this week, at least.
Byte 55 of MCD entry defines the explosion strength, byte 56 sets the explosion type (HE, smoke, IN or stun)
Thanks.

EDIT by Meridian: for future readers, questions are about OXCE, even though the thread is in OpenXcom section
Could you move it to the right forum, then?

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Thanks, I woudn't have thought to try numbers above 2. Not this week, at least. Thanks.

It's byte 54, not 56, that defines the explosion type. I've edited my previous reply with the correct answer.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Something else, although related. The mission gives a piece of research with incomplete and partially incorrect information. (Regardless of how and where it appears.) A player can later conduct research, that gives results contradicting the first report. It would make sense to remove the first report from Ufopaedia when the 2nd is finished. Is it possible?

Yes, it's possible to disable/delete previously researched topic: https://openxcom.org/forum/index.php/topic,5482.msg86298.html#msg86298