aliens

Author Topic: a new item flag that limits item fuctionality / map type  (Read 8084 times)

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
a new item flag that limits item fuctionality / map type
« on: February 11, 2015, 04:55:23 am »
for example let's say smoke doesn't work on mars
or coveralls or personal armor won't work on marks either so anyone wearing those will die
you can make certain weapons not work in certain maps for example let's say there is a shield of some sort that inhibits lasers working properly inside alien bases so if your soldiers have one such weapon it simply won't shoot.

and so forth

items:
   type: STR_PISTOL
   ....
   disabledForMaps:
      -FOREST
      -MOUNTAIN
   ...

only usable for weapons (including ship weapons), armor

if armor the effect is soldier dies
if weapon the effect is weapon does not shoot

the idea is you can make certain special maps like acid pools or lava or underground  or space where soldiers are unable to breather or use certain type of weapons due to no air or other reasons.
« Last Edit: February 11, 2015, 05:03:24 am by tollworkout »

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: a new item flag that limits item fuctionality / map type
« Reply #1 on: February 11, 2015, 11:18:41 am »
interesting idea... I'm sure something like that will have to be implemented anyway, because TFTD makes a difference between "underwater" and "above water" missions. question is how that is going to be done, and if it can be extended for more options (underwater - above water - space - sub zero - heavy winds - toxic atmosphere - ...)

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #2 on: February 11, 2015, 11:42:18 am »
interesting idea... I'm sure something like that will have to be implemented anyway, because TFTD makes a difference between "underwater" and "above water" missions. question is how that is going to be done, and if it can be extended for more options (underwater - above water - space - sub zero - heavy winds - toxic atmosphere - ...)

is probably easiest to simply have a

worksUnderwater: true
worksAbovewater: true

or even

functionalityMode: 0 # 0 = water 1 = land 2 = both

Still . Would be nice to have more maps more areas where certain items work and others don't. IT would be more tactical and much harder in a way.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #3 on: February 11, 2015, 03:53:29 pm »
Actually, you could conceptualize it as:

Define an "Environment" category for terrains which accepts any user input. Defaults are Land and Underwater but modders can add other ones

Add a "worksInEnv" list property for items, which takes a list of environments the thing works in.

Vanilla EU&TftD stuff would look like:
Code: [Select]
terrains:
  - name: DESERT
  [...]
    environment: Land

items:
- type: STR_LASER_RIFLE
  [...]
  requires:
    - STR_LASER_RIFLE
  worksInEnv:
    - Land

- type: STR_DISPLACER_PULSE_LAUNCHER
  [...]
  requires:
    - STR_DISPLACER_PULSE
  worksInEnv:
    - Underwater
whereas modders could do:
Code: [Select]
- type: STR_UBER_WEAPON
  [...]
  requires:
    - NOTHING
  worksInEnv
    - Land
    - Underwater
    - Space
    - Volcano
    - Arctic

Then when generating a mission, check the armors worn by soldiers. If it does not have the current environment in its "worksInEnv" property, don't spawn the soldier. For weapons, it works exactly like "requires", but checks against the current environment instead of the known techs.\

That sounds like something that could be done in OpenXCom Extended...

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #4 on: February 11, 2015, 04:20:20 pm »
That would be awesome and do-able. Probably useful later on with TFTD conversion.

You know what.

It could work like alien races.

environments:
   - type: OVERGROUND
        members:
           - FOREST
           - MOUNTAIN
    - type: SPACE
        members:
            - STATION
            - ASTEROID

items:
   - type: STR_PERSONAL_ARMOR
     ....
     environments:
        - OVERGROUND < only works in overground everywhere else user is insta killed ...


   - type: STR_SPACE_SUIT
     ..
     environments:
        - OVERGROUND
        - SPACE
« Last Edit: February 11, 2015, 04:53:31 pm by tollworkout »

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #5 on: February 11, 2015, 05:12:04 pm »
I think defining an environment property per terrain (each terrain should realistically only be part of one environment) is easier, but either way works (and neither of us are gonna code it any ways ;)).

It could indeed work for TftD as well, we'll see if it is already implemented and how it works eventually.

I don't understand why you want to instakill units with the wrong armor type though. Not spawning them (representing them hanging out in a secure area of the craft, say the cockpit, or having stayed at the base because they know they can't operate in that environment) seems much more reasonable to me. Do you really think they would go to space, forget their space suit and not think of it before opening the door and being decompressed to death? We have to give *some* credit to the poor XCom Operatives...

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #6 on: February 11, 2015, 06:57:45 pm »
This should be possible in TFTD as described above.

But the interesting part would be to automatically limit the type of weapons you can load into the transport based on the map. That way you can prevent getting to a ground mission and find out that half your weapons don't work.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #7 on: February 11, 2015, 07:28:25 pm »
But how would the game know which mission you're loading the craft for? I have often redirected a transport mid-flight as well..

Also, getting a terror mission, trying to scramble your craft just to get a "can't launch with a displacer pulse launcher on board" message would be more annoying to me than leaving it on the ground for the mission. Since there is no equipment limit in OpenXCom, pack the craft with alternatives and use what you can/want given the environment/opposition.

Environments should be listed in the UFOPaedia, either as a stat of fluff text, and then the user can make their choice. If one wants to clean up a terror site with torpedoes, let them try. They will learn pretty quickly not to. I know I did when I first played TftD and found half my stuff didn't work on the first terror mission.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #8 on: February 11, 2015, 07:34:05 pm »
But how would the game know which mission you're loading the craft for? I have often redirected a transport mid-flight as well..

Ah. Well theoretically the game can look up what missions are possible (alien bases, terror and mission sites, UFOs/USOs), so if there is an active terror/port/ship attack then it could at least display a warning: "This weapon doesn't work on land environments" when loading the Triton with sea weapons.

I don't know exactly how to do it, just think of something to help preventing the 'torpedos on land' situation.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #9 on: February 11, 2015, 07:45:53 pm »
A warning message that list nonoperational equipment when targeting a site with a transport could work.

Code: [Select]
Select transport -> Assign target -> if checkpoint, do nothing
                                  -> if site, check equipment -> list failed equipment in a warning.

But there is an issue with this if you equip your transports for all occasions (taking advantage of the removal of max # of items): you'll get a warning very often..

Maybe as an option? That kind of "hand holding" may not be appreciated by everyone (and certainly not vanilla-like).

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #10 on: February 12, 2015, 04:14:08 am »
How about simply give a warning before you press OK. A generic warning like this before you click OK button:

"You are using non specific environment gear. Proceed?"
Yes/No

in TFTD land weapons simply don't work if you happen to be in water and vice versa and some weapons work in both environments. I kinda like that because you gotta know in advance what's good for you.


Also some  units "fly" on land and in water some only "fly" in water  and some do both.  By fly meaning 3D movement.

In OpenXCom you have movementType 0 no flying just walking everywhere and 1 flying everywhere

How about something like this

movementType : 1   < flying
movementTypeEnv:  < only apply movementType for the following env..everywhere else is walking
    - SPACE
    - WATER

movementTypeEnv only required if you choose movementType of 1 (3D motion)

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #11 on: February 12, 2015, 04:44:18 am »
I don't understand why you want to instakill units with the wrong armor type though. Not spawning them (representing them hanging out in a secure area of the craft, say the cockpit, or having stayed at the base because they know they can't operate in that environment) seems much more reasonable to me. Do you really think they would go to space, forget their space suit and not think of it before opening the door and being decompressed to death? We have to give *some* credit to the poor XCom Operatives...

Right! That could work. Simply they don't appear in the battlescape cause they don't have the right outfit. But they are still in the ship somewhere.


Also I was thinking. What if ships that crash in non specific environments have different map symbol/color other than the default ones. And also requier spcific ships to go there. So redirecting a ship in flight to a target might give you an error "This craft is not equipped to travel there" Then modders can simply make different sets of map symbol for each environment like flying, crashed, terror mission etc.
« Last Edit: February 12, 2015, 04:50:09 am by tollworkout »

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #12 on: February 12, 2015, 04:57:05 pm »
I think the ability to customize craft/UFO/site symbols has recently been/will soon be introduced.

The region restriction is necessary for TftD since the starting subs can't operate at the deepest depths if I remember well (but oddly enough even the starting diving pajamas with a fishbowl hat are fine down there I think, provided you have the proper sub to deliver you there). Or the sub weapons not working out of water.

It will be a cool feature to use, especially in hybrid EU/TftD games where you will have crafts that can deploy on land or underwater but maybe not both.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: a new item flag that limits item fuctionality / map type
« Reply #13 on: February 13, 2015, 03:29:01 pm »
I think the ability to customize craft/UFO/site symbols has recently been/will soon be introduced.

The region restriction is necessary for TftD since the starting subs can't operate at the deepest depths if I remember well (but oddly enough even the starting diving pajamas with a fishbowl hat are fine down there I think, provided you have the proper sub to deliver you there). Or the sub weapons not working out of water.

It will be a cool feature to use, especially in hybrid EU/TftD games where you will have crafts that can deploy on land or underwater but maybe not both.

EXCITED

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11464
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: a new item flag that limits item fuctionality / map type
« Reply #14 on: February 26, 2015, 08:08:17 am »
Apart from basic functionality (pew/no pew), I wonder if it would be fun to have different properties for weapons in various environments. For example, many modern firearms can fire underwater just fine, but their range is absolutely pitiful - in game terms, the accuracy drop is very fast in this environment. Similar for lasers.

Placing all the data for various terrains in the game would be a pain though.