Author Topic: Clips should be able to change weapons images (big, hands and floor)  (Read 11857 times)

Offline CanadianBeaver

  • Colonel
  • ****
  • Posts: 184
    • View Profile
    • AwesomeGuns
I think it is clear. Example: the weapons loaded by standard clips and alloy clips have the different their looks.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #1 on: August 30, 2016, 08:09:41 pm »
You should talk to Yankes about this one - it might be already possible with his scripts for OXCE, since there's already IvanDogovich's piratez mod to change corpse bigobs/floorobs based on fatal wounds/stun, and this sounds like a pretty similar concept.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #2 on: August 30, 2016, 08:41:30 pm »
I think the Handobs sprites are too small to visually make a difference - either you recolor the entire weapon according to the clip, or for each frame only a couple of pixels will have a different color (or even none, depending on direction that the weapon is facing)

More useful would be to have a small message box appearing and displaying the ammo type when the mouse cursor hovers over the weapon, like XCOM 2 does

Offline CanadianBeaver

  • Colonel
  • ****
  • Posts: 184
    • View Profile
    • AwesomeGuns
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #3 on: August 30, 2016, 09:18:44 pm »
I think the Handobs sprites are too small to visually make a difference - either you recolor the entire weapon according to the clip, or for each frame only a couple of pixels will have a different color (or even none, depending on direction that the weapon is facing)

More useful would be to have a small message box appearing and displaying the ammo type when the mouse cursor hovers over the weapon, like XCOM 2 does

Please, imagine the rocket launcher like RPG, where the grenade holds outside of launcher. Or the plasma weapons with lighting that depends on type of clips.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #4 on: August 30, 2016, 09:30:16 pm »
You should talk to Yankes about this one - it might be already possible with his scripts for OXCE, since there's already IvanDogovich's piratez mod to change corpse bigobs/floorobs based on fatal wounds/stun, and this sounds like a pretty similar concept.
Yes, this right now possible in OXCE. It could be done in two ways, separate graphic for each weapon or recoloring same graphic for all clips.
Ground, hand and inventory graphic can be changed.

Offline CanadianBeaver

  • Colonel
  • ****
  • Posts: 184
    • View Profile
    • AwesomeGuns
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #5 on: August 30, 2016, 09:39:45 pm »
Yes, this right now possible in OXCE. It could be done in two ways, separate graphic for each weapon or recoloring same graphic for all clips.
Ground, hand and inventory graphic can be changed.

Can you show an example from .rul?

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #6 on: August 30, 2016, 10:48:31 pm »
Please, imagine the rocket launcher like RPG, where the grenade holds outside of launcher. Or the plasma weapons with lighting that depends on type of clips.

Have you considered this system would be totally dependent on color? And that color blindness, in one form or the other, affects about 10% of the world population?

Or that there's 8 vanilla damage types, so you'd need at least 7 different colors (for Melee it wouldn't be needed) but the palettes are limited in choice? And if you use some colors like yellow, green, brown, etc., the lightning will be barely discernible when superimposed against the terrain?

Imagine that when you hover the cursor over the weapon, it displays both the damage type and the damage power. To me that would be a lot more useful than a lot of flashy graphic effects that won't be that easy to distinguish and that will be there just for the firework show. But this is only my opinion.
« Last Edit: August 30, 2016, 10:51:00 pm by Hobbes »

Offline CanadianBeaver

  • Colonel
  • ****
  • Posts: 184
    • View Profile
    • AwesomeGuns
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #7 on: August 30, 2016, 10:58:18 pm »
Have you considered this system would be totally dependent on color? And that color blindness, in one form or the other, affects about 10% of the world population?

Or that there's 8 vanilla damage types, so you'd need at least 7 different colors (for Melee it wouldn't be needed) but the palettes are limited in choice? And if you use some colors like yellow, green, brown, etc., the lightning will be barely discernible when superimposed against the terrain?

Imagine that when you hover the cursor over the weapon, it displays both the damage type and the damage power. To me that would be a lot more useful than a lot of flashy graphic effects that won't be that easy to distinguish and that will be there just for the firework show. But this is only my opinion.

Sorry, I did not think about cursor and I do not want to discuss about "what is better - cursor or color?". I want to have an opportunity to change the image (not color) of the weapons in the game which depends on the type of clip.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #8 on: August 30, 2016, 11:15:17 pm »
I want to have an opportunity to change the image (not color) of the weapons in the game which depends on the type of clip.

If you are serious about considering the functionality of the OpenXcom Extended branch, I might be willing to show you the script that we use to change corpse object images.  But as far as I understand from previous conversation, you want to stay Debian and 1.0 milestone. 

If you aren't interested in the features that OpenXcom Extended offers then this will be no interest to you.

Offline CanadianBeaver

  • Colonel
  • ****
  • Posts: 184
    • View Profile
    • AwesomeGuns

Offline CanadianBeaver

  • Colonel
  • ****
  • Posts: 184
    • View Profile
    • AwesomeGuns
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #10 on: August 30, 2016, 11:49:46 pm »
Sorry, I think I am wrong. OpenXcom Extended is OXCE, is not it? Or are these things different?

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #11 on: August 30, 2016, 11:56:24 pm »
OXC = OpenXCom (ideally followed by 1.0 or nightly to specify which one istalked about)
OXCE = OpenXCom Extended, Yankes' branch (hence why Yankes was mentioning it)
OXCE+ = OpenXCom Extended, plus Meridian's changes

So yes, Ivan was making sure you weren't wasting either yours or Yankes' time by looking into a feature you are unlikely to actually want to use.

That being said, it would be a nice thing to have for the RPG in XPiratez, for example. To see if it's a nuke that's loaded in there.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #12 on: August 31, 2016, 12:41:33 am »
(edited)
Even in vanilla UFO, it would be prettier if the empty Heavy Plasma was displayed without its banana clip.
« Last Edit: August 31, 2016, 02:30:59 pm by yrizoud »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #13 on: August 31, 2016, 12:47:34 am »
Can you show an example from .rul?

Here is implementation for custom (3 possible version per weapon) graphic based on ammo:
Code: [Select]
extended:
  tags:
    RuleItem:
      CUSTOM_GUN_GRAPHIC_ALT_MOD: RuleList
      CUSTOM_GUN_GRAPHIC_ALT_1: int
      CUSTOM_GUN_GRAPHIC_ALT_2: int
      CUSTOM_GUN_GRAPHIC_ALT_3: int
      CUSTOM_GUN_GRAPHIC_ALT_SELECT: int
  scripts:
    selectItemSprite:
      - offset: 1
        code: |
          var int version;
          var int temp;
          var ptr BattleItem ammo;
          var ptr RuleItem weaponType;
          var ptr RuleItem ammoType;
         
          #only for big sprites
          if neq blit_part blit_item_big;
            return sprite_index;
          end;
         
          item.getAmmoItem ammo;
          item.getRuleItem weaponType;
          ammo.getRuleItem ammoType;
          ammoType.getTag version Tag.CUSTOM_GUN_GRAPHIC_ALT_SELECT;
         
          if neq version 0;
            weaponType.getTag temp Tag.CUSTOM_GUN_GRAPHIC_ALT_MOD;
            if eq version 1;
              weaponType.getTag sprite_index Tag.CUSTOM_GUN_GRAPHIC_ALT_1;
            else eq version 2;
              weaponType.getTag sprite_index Tag.CUSTOM_GUN_GRAPHIC_ALT_2;
            else eq version 3;
              weaponType.getTag sprite_index Tag.CUSTOM_GUN_GRAPHIC_ALT_3;
            end;
            rules.getSpriteOffsetBigobs sprite_index temp;
          end;
          return sprite_index;
items:
  - type: STR_SOME_WEAPON
    bigSprite: 110
    tags:
      CUSTOM_GUN_GRAPHIC_ALT_MOD: current #in what mode graphic is defined
      CUSTOM_GUN_GRAPHIC_ALT_1: 111 #next `bigSprite` value
      CUSTOM_GUN_GRAPHIC_ALT_2: 112
      CUSTOM_GUN_GRAPHIC_ALT_3: 112

  - type: STR_AMMO_FOR_SOME_WEAPON_1
    tags:
      CUSTOM_GUN_GRAPHIC_ALT_SELECT: 1
  - type: STR_AMMO_FOR_SOME_WEAPON_2
    tags:
      CUSTOM_GUN_GRAPHIC_ALT_SELECT: 2
  - type: STR_AMMO_FOR_SOME_WEAPON_3
    tags:
      CUSTOM_GUN_GRAPHIC_ALT_SELECT: 3


Offline CanadianBeaver

  • Colonel
  • ****
  • Posts: 184
    • View Profile
    • AwesomeGuns
Re: Clips should be able to change weapons images (big, hands and floor)
« Reply #14 on: August 31, 2016, 03:58:24 am »
It will be great, if openxcom has something simple, like that:

Code: [Select]
- myweapon
    bigimage: 111
    compatibleammo:
      - myclip 

- myclip
    bigimage: 112
    bigimage_PARENT: 113

PS: I am speaking about OpenXcom