aliens

Author Topic: [DONE] craft preview  (Read 9423 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: [DONE] craft preview
« Reply #15 on: April 25, 2022, 12:02:41 am »
I'm not changing a simple, elegant, consistent and commonly-used solution.

Simple = literally two lines of code (1 to save, 1 to load)
Elegant = raw unobscured YAML, what you see is exactly what you get
Consistent = same as 99.9% of the rest
Commonly-used = there are many other objects in the openxcom save file, which are saved in the same way (tip: look at a battlescape save); or look at mod rulesets

Losing these four qualities just to gain a bit of (questionable) human-readability has zero priority for me.

For a correct raw representation, you'd have to make a new class. Considering this object has very limited usage, I agree that adding a new class would be an overkill.

This part is actually what I would even be willing to do.
A class (or struct) overhead doesn't cost too much and adds to c++ code readability too.
Fun fact: this is even currently used for storing data about HWPs (which use a completely different structure than soldiers; again for a good reason).

Code: [Select]
        customVehicleDeployment:
          - type: STR_TANK_CANNON
            pos:
              - 4
              - 9
              - 1
            dir: 0

The biggest issue with your proposed change is not wrapping a few fields into a class (or struct), but changing std::map (YAML dictionary) into std::vector (YAML list), which I'm not willing to do in any case.


At the end of the day, the current solution has overwhelmingly more advantages for me than your counter-proposal and will stay as is.
« Last Edit: April 25, 2022, 12:32:26 am by Meridian »

Online Delian

  • Commander
  • *****
  • Posts: 501
    • View Profile
Re: [DONE] craft preview
« Reply #16 on: April 25, 2022, 01:00:06 am »
which I'm not willing to do in any case.

Ok. Then, as you said, you're willing to change std::pair<Position, int> into a struct. Can you do that then?
« Last Edit: May 25, 2022, 12:40:17 pm by Delian »

Online Delian

  • Commander
  • *****
  • Posts: 501
    • View Profile
Re: [DONE] craft preview
« Reply #17 on: June 21, 2022, 05:20:35 pm »
I have a new suggestion for the craft preview. Can you please temporarily set the Player Movement Speed to the maximum (or even faster - just teleport units) during the craft preview? I like using slower movement speed in the battlescape, but in the preview that's too slow and it's kinda bothersome having to keep changing the speed back and forther every time i use the preview.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: [DONE] craft preview
« Reply #18 on: June 21, 2022, 05:54:15 pm »
it is already possible to teleport

Online Delian

  • Commander
  • *****
  • Posts: 501
    • View Profile
Re: [DONE] craft preview
« Reply #19 on: June 21, 2022, 06:58:48 pm »
Oh, I'm dumb. Well, it would be useful to mention the shortcut in the in-game help text.
« Last Edit: June 21, 2022, 07:10:45 pm by Delian »

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 685
    • View Profile
Re: [DONE] craft preview
« Reply #20 on: July 07, 2022, 08:58:17 pm »
Is there a way to get not to reveal the whole map like the other deployment´s? by changing a line in aliendeployment?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: [DONE] craft preview
« Reply #21 on: July 07, 2022, 09:01:44 pm »
Is there a way to get not to reveal the whole map like the other deployment´s? by changing a line in aliendeployment?

no, but I can easily add it if needed

why would you want to hide something?

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 685
    • View Profile
Re: [DONE] craft preview
« Reply #22 on: July 07, 2022, 11:28:40 pm »
kind of brakes the emersion viewing the hollow part

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: [DONE] craft preview
« Reply #23 on: July 09, 2022, 06:13:35 pm »
I've mapped it to one of the existing fields.
Only works for the craft preview deployment, other deployments are unaffected by it.

Code: [Select]
  isHidden: true  # reveals the whole map
  isHidden: false # does not reveal the whole map

For example:

Code: [Select]
alienDeployments:
  - type: STR_CRAFT_DEPLOYMENT_PREVIEW
    isHidden: false
    music:
      - HANGAR
    briefing:
      title: STR_HANGAR_TITLE
      palette: 4
      desc: STR_HANGAR_DESCRIPTION
      music: HANGAR
      showCraft: true
      showTarget: false
      background: BACK16.SCR
    shade: 1
    terrains:
      - XHANGAR
    script: XHANGAR
    width: 30
    length: 20
    height: 6

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 685
    • View Profile
Re: [DONE] craft preview
« Reply #24 on: July 12, 2022, 04:48:11 pm »
Thks

Online Delian

  • Commander
  • *****
  • Posts: 501
    • View Profile
Re: [DONE] craft preview
« Reply #25 on: July 27, 2022, 10:17:52 am »
Edited: nevermind, I'm dumb
« Last Edit: July 27, 2022, 01:20:23 pm by Delian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: [DONE] craft preview
« Reply #26 on: July 27, 2022, 12:33:41 pm »
Yeah, fuck that. Pardon my English.

There's at most one person on Earth, who remembers and understands what you just wrote. I have no need for that kind of stuff.

There's already two algorithms:
1. ID/dictionary based: for perfect control (only if needed!!), for a price of more work... intended to be used rarely
2. order/queue based: persistent, not ID-based, for general order control (if you disagree with the modder's default deployment proposal), only needs to be done once per craft

I'm not gonna do a custom algorithm for each player, sorry.

PS: I'm not erasing the whole list when removing soldiers, it's explicitly written in the first post


Online Delian

  • Commander
  • *****
  • Posts: 501
    • View Profile
Re: [DONE] craft preview
« Reply #27 on: July 27, 2022, 01:21:51 pm »
Sorry, I'm dumb. I was only using the craft preview, where I should've been using both craft preview and craft type preview. Somehow it didn't click in my head that craft type preview was already using order-based deployment. Everything works perfectly fine then!
« Last Edit: July 27, 2022, 01:28:34 pm by Delian »