aliens

Author Topic: An help about Extra Sprite handling!  (Read 13117 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #15 on: June 18, 2017, 09:30:50 pm »
If i go for scripts, i need to create my own exe

Actually, you don't need a new exe... scripts are written in the ruleset files (and interpreted by existing exe)... not having to change the exe was the whole point of introducing scripts.
But as I said, it's not easy at the beginning... you need to have at least a little bit of experience with scripting or programming... or have someone do it for you :) Ohartenstein might volunteer, if you ask nicely :P

Offline drages

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #16 on: June 18, 2017, 09:53:24 pm »
Actually, you don't need a new exe... scripts are written in the ruleset files (and interpreted by existing exe)... not having to change the exe was the whole point of introducing scripts.
But as I said, it's not easy at the beginning... you need to have at least a little bit of experience with scripting or programming... or have someone do it for you :) Ohartenstein might volunteer, if you ask nicely :P

Hmm.. then it's better then i guessed.. I downloaded the big mods and most of them comes with their own all files including exe.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #17 on: June 18, 2017, 10:21:22 pm »
I have a script already written that changes sprites based on loaded ammo, IvanDogovich asked for it a while back to change the Piratez RPG sprites when a baby nuke is loaded.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: An help about Extra Sprite handling!
« Reply #18 on: June 18, 2017, 10:51:57 pm »
Hmm.. then it's better then i guessed.. I downloaded the big mods and most of them comes with their own all files including exe.

Yeah. Those that do, (X-PirateZ, Xcom-Files, etc.) are usually doing so because they require the OXCE+ executable to work.  Its easier just to package that into the mod, than to deal with all of the confusion that would come from players trying to use a vanilla OXC executable.   

If you are going to do things like the bigob sprites, etc, you still probably will want to package a version of OXCE+ with your mod when you publish.  ("Final Mod Pack - Extended Plus"??)

Offline drages

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #19 on: June 18, 2017, 11:16:21 pm »
Yeah. Those that do, (X-PirateZ, Xcom-Files, etc.) are usually doing so because they require the OXCE+ executable to work.  Its easier just to package that into the mod, than to deal with all of the confusion that would come from players trying to use a vanilla OXC executable.   

If you are going to do things like the bigob sprites, etc, you still probably will want to package a version of OXCE+ with your mod when you publish.  ("Final Mod Pack - Extended Plus"??)

Then i need to have all FMP files together as a stand-alone. I will probably do it after non-script addition i plan to do.  For now, i don't plan to create big different things then vanilla.. some cool additions can help like more weapon aircrafts, this bigob changing.. My biggest fear is breaking something at FMP when i go for XCE+, because i am just a noob to correct a huge mod at this time. I don't know even what can be happen at all.

For example i looked for personal shields but sadly there is no way to probably do it. When i hear openxcom, i thought it will be already ultra modable version with no hardcode or limitation at all but as i see it has many points which stops modders at some ways..

I have a script already written that changes sprites based on loaded ammo, IvanDogovich asked for it a while back to change the Piratez RPG sprites when a baby nuke is loaded.

It's very nice. I got some cool energy weapons which could use some bigob changing per ammo! Can you pinpoint me the script and how to use it please?

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #20 on: June 19, 2017, 02:16:25 am »
Sure, I'm traveling this weekend, so I'll find the files later this week. I also made a script for personal shields, so you're in luck!

Offline drages

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #21 on: June 19, 2017, 02:51:30 am »
Sure, I'm traveling this weekend, so I'll find the files later this week. I also made a script for personal shields, so you're in luck!

S working shield! Perfect. I hope it works for aliens too.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #22 on: June 20, 2017, 06:57:14 pm »
Okay, here are the scripts.  First up, switching weapon sprites based on the loaded ammunition.  I've attached the mod I made for Ivan using his sprites to make the RPG in Piratez change its sprite when a Baby Nuke is loaded - this provides a good example of how the script works.  In your mod, you'll only need to copy over the file weaponSpriteBasedOnAmmoScript.rul, and then follow the example in the other ruleset file for each weapon/ammo combination you want to set up.  In the weapon ruleset definition, you just need the extra tag ALLOW_AMMO_TO_RESPRITE: 1 to enable the new feature in the script, then use the tags in the ammo item (NEW_BIGOB_FOR_WEAPON: <some number>, NEW_FLOOROB_FOR_WEAPON: <some number>, NEW_HANDOB_FOR_WEAPON: <some number>, and CURRENT_MOD_OFFSET: current) to pass the new sprite numbers back to the weapon.  Unfortunately this means that sharing ammo between two weapons that have this feature activated will cause them both to use the same set of sprites - this is a limitation of how I implemented the sprite switching, focused on making the ruleset as simple as possible.

As for the personal energy shields, I put together a sample ruleset for SuperCaffeineDude a little while back, if you just want to add it to armor definitions, that is available in this thread, with a short explanation of how to use it.  To have it work for the aliens as well, all you need to do is add the proper tags to their armor definitions.

If you want a more complete set of scripts for various other defensive options including having energy shields as a held item, look for the file YankesScripts.rul in the Piratez download.  It contains the armor-based energy shields I sent to SuperCaffeineDude as well as a few other things I've written, some of which are implemented in Piratez.

Offline drages

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #23 on: June 20, 2017, 09:23:51 pm »
Okay, here are the scripts.  First up, switching weapon sprites based on the loaded ammunition.  I've attached the mod I made for Ivan using his sprites to make the RPG in Piratez change its sprite when a Baby Nuke is loaded - this provides a good example of how the script works.  In your mod, you'll only need to copy over the file weaponSpriteBasedOnAmmoScript.rul, and then follow the example in the other ruleset file for each weapon/ammo combination you want to set up.  In the weapon ruleset definition, you just need the extra tag ALLOW_AMMO_TO_RESPRITE: 1 to enable the new feature in the script, then use the tags in the ammo item (NEW_BIGOB_FOR_WEAPON: <some number>, NEW_FLOOROB_FOR_WEAPON: <some number>, NEW_HANDOB_FOR_WEAPON: <some number>, and CURRENT_MOD_OFFSET: current) to pass the new sprite numbers back to the weapon.  Unfortunately this means that sharing ammo between two weapons that have this feature activated will cause them both to use the same set of sprites - this is a limitation of how I implemented the sprite switching, focused on making the ruleset as simple as possible.

As for the personal energy shields, I put together a sample ruleset for SuperCaffeineDude a little while back, if you just want to add it to armor definitions, that is available in this thread, with a short explanation of how to use it.  To have it work for the aliens as well, all you need to do is add the proper tags to their armor definitions.

If you want a more complete set of scripts for various other defensive options including having energy shields as a held item, look for the file YankesScripts.rul in the Piratez download.  It contains the armor-based energy shields I sent to SuperCaffeineDude as well as a few other things I've written, some of which are implemented in Piratez.

They look great! but the biggest question is, does it work with nighties or should i do something else?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11464
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: An help about Extra Sprite handling!
« Reply #24 on: June 20, 2017, 11:10:10 pm »
They look great! but the biggest question is, does it work with nighties or should i do something else?

It needs OXCE+, of course.

Offline drages

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #25 on: June 20, 2017, 11:15:33 pm »
It needs OXCE+, of course.

If I use it, will be there any problem with FMP?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11464
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: An help about Extra Sprite handling!
« Reply #26 on: June 20, 2017, 11:27:39 pm »
If I use it, will be there any problem with FMP?

No, it should work just fine.
But you might want to get the extra strings for OXCE+ additional options.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #27 on: June 21, 2017, 12:17:42 am »
If I use it, will be there any problem with FMP?

Commendations will not work, you will need to replace them with earlier version (FMP 1.9.6 or earlier).
Otherwise should work OK.

Offline drages

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #28 on: June 21, 2017, 12:58:45 am »
Thx. I will try it.

I collected very nice weapon branches from New and old mods. I noticed some very old mods too at this research, like xeno operations. I fall in love with the ufo designs. It's strange thati don't see those at other mods for years.

So with xce there won't be over 1000 Id at sites problem too which I will have probably.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: An help about Extra Sprite handling!
« Reply #29 on: June 21, 2017, 10:35:53 am »
So with xce there won't be over 1000 Id at sites problem too which I will have probably.

There is a new attribute in metadata.yaml in OXCE/OXCE+, which you can use to extend the reserved space for your mod.

Code: [Select]
reservedSpace: 1 # this is the default, max. ID you can use = 999

You can increase it to any number you want... but don't go too high if you don't need it.

Code: [Select]
reservedSpace: 2 # up to 1999
reservedSpace: 3 # up to 2999
reservedSpace: 4 # up to 3999
and so on...