aliens

Author Topic: Medikit-type item without the medikit screen?  (Read 4959 times)

Offline ISemiI

  • Squaddie
  • *
  • Posts: 4
  • [HIDDEN MOVEMENT INTENSIFIES]
    • View Profile
Medikit-type item without the medikit screen?
« on: May 28, 2015, 12:19:49 am »
First off, hey guys ^^. Long(ish) time lurker, first time poster.

I'm working on a small mod that adds a basic "field dressing" bandage for the treatment of a single fatal wound, with the intention being that it's much lighter than a standard medikit but without nearly as much healing power - purely for stabilisation purposes to stop a wounded agent bleeding out before a properly equipped medic can attend to them. As you probably guessed from the title, I'm wondering if I'd be able to do away with the medikit interface and simply have the use of the item heal the wound - I'm brand new to modding OpenXCom and I'm still not sure of what is possible and what isn't.

Additionally, the game crashes every time I attempt to throw or drop one - for the time being I'm using the pistol magazine's sprite as a substitute for testing, but I'd like to figure out what's going on. I'm assuming it's something to do with the floorob ID, a conflict or something, since I can see no problems with the image itself or the path to the image within the ruleset file. If that is indeed the problem, which floorob IDs are available for use? I've tried a wide range and come up with a crash each time.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Medikit-type item without the medikit screen?
« Reply #1 on: May 28, 2015, 12:51:23 am »
I think there are 73 floorobs defined in the game, so IDs 0-72 are already used, unless you are actually trying to replace something. And it is not good to go over 999. Anything else is up for grabs (and mods won't conflict as they get their own 1000 each).

Something you could try at first is to not define a floorob, but just use 4 (the pistol clip from the game) to see if that works.

Are you sure you are using the right format for images? XCom images are all kinds of weird.

Offline ISemiI

  • Squaddie
  • *
  • Posts: 4
  • [HIDDEN MOVEMENT INTENSIFIES]
    • View Profile
Re: Medikit-type item without the medikit screen?
« Reply #2 on: May 28, 2015, 01:02:53 am »
I think there are 73 floorobs defined in the game, so IDs 0-72 are already used, unless you are actually trying to replace something. And it is not good to go over 999. Anything else is up for grabs (and mods won't conflict as they get their own 1000 each).

Something you could try at first is to not define a floorob, but just use 4 (the pistol clip from the game) to see if that works.

Are you sure you are using the right format for images? XCom images are all kinds of weird.
Yeah, I swapped the sprite out with the pistol mag after about half an hour of trying different things. Come to think of it, pretty much every ID I tried was over 72, so it seems it is something to do with the image.

The image itself is a plain old .gif, 32x40 - see attached. Hoping it's just something simple I've messed up here ^^

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Medikit-type item without the medikit screen?
« Reply #3 on: May 28, 2015, 01:59:55 am »
Ah! I believe you have a palette issue..

I suggest you head over to the Tools section, to see what people use for making graphics.

I am a fan of falko's tools. Make an image with the right colours (OpenXCom, like XCom, only uses 256 colors you have to pick from those), run it through the palette converter to change the RGB codes into palette index, and it'll work.

Offline ISemiI

  • Squaddie
  • *
  • Posts: 4
  • [HIDDEN MOVEMENT INTENSIFIES]
    • View Profile
Re: Medikit-type item without the medikit screen?
« Reply #4 on: May 28, 2015, 02:24:13 am »
Ah! I believe you have a palette issue..

I suggest you head over to the Tools section, to see what people use for making graphics.

I am a fan of falko's tools. Make an image with the right colours (OpenXCom, like XCom, only uses 256 colors you have to pick from those), run it through the palette converter to change the RGB codes into palette index, and it'll work.
Brilliant - managed to get it working at last. Just needs a bit of tweaking and resizing now. Thanks! ^^

Along with removing the medikit interface, does anyone know if it'd be possible to make it a "disposable" item that is removed from the inventory after use?

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Medikit-type item without the medikit screen?
« Reply #5 on: May 28, 2015, 03:59:17 am »
I don't think it is possible to do either, unfortunately. Yankes might be able to help you though, if you ask in the OpenXCom Extended thread. I think he is intending to have disposable items at least, and making a medikit apply what it can if it only has one choice sounds feasible, if a bit risky.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Medikit-type item without the medikit screen?
« Reply #6 on: May 28, 2015, 04:15:10 am »
You might also look at the setup for the "bandage" in PirateZ.  The setup is pretty similar to what you want.

Cheers, Ivan :D

Offline ISemiI

  • Squaddie
  • *
  • Posts: 4
  • [HIDDEN MOVEMENT INTENSIFIES]
    • View Profile
Re: Medikit-type item without the medikit screen?
« Reply #7 on: May 28, 2015, 06:44:33 pm »
I don't think it is possible to do either, unfortunately. Yankes might be able to help you though, if you ask in the OpenXCom Extended thread. I think he is intending to have disposable items at least, and making a medikit apply what it can if it only has one choice sounds feasible, if a bit risky.
Ah, I see. I think I'll just leave its function as-is, in that case.

You might also look at the setup for the "bandage" in PirateZ.  The setup is pretty similar to what you want.

Cheers, Ivan :D
Hm, I took a look and it seems pretty much identical to what I have at the moment. That is, just from looking at the ruleset - I'm not sure if it functions differently in practice. I should probably download the nightly and try it out.