Author Topic: [OLD] Old OXCE+ discussion thread  (Read 720375 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1680 on: September 08, 2018, 04:00:26 am »
I'm getting a problem in which upon starting a new game, I can immediately manufacture many things that I should not yet or never should be able to manufacture. I don't think this was happening until I installed 4.0, and I don't see anything in my mod that would be causing it.

Mods: my mod only


P.S.: Does 4.0 include the feature to make chryssalids have a chance to fail based on armor?
« Last Edit: September 08, 2018, 04:02:40 am by The Reaver of Darkness »

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1681 on: September 08, 2018, 04:11:55 am »
P.S.: Does 4.0 include the feature to make chryssalids have a chance to fail based on armor?
fail doing what? zombify enemy? If yes then yes, script can alter success chance of zombification.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1682 on: September 08, 2018, 05:08:34 am »
fail doing what? zombify enemy? If yes then yes, script can alter success chance of zombification.
Excellent! How do I use it? I want to make armor suits cause the soldier to resist zombification just as they resist melee damage.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1683 on: September 08, 2018, 07:51:40 am »
I'm getting a problem in which upon starting a new game, I can immediately manufacture many things that I should not yet or never should be able to manufacture. I don't think this was happening until I installed 4.0, and I don't see anything in my mod that would be causing it.

The game now checks, if research topics exist on many places... and if not, either crashes on start or writes errors in the log file and skips non-existing research... please check the log file.

After having done the upgrade to V4.0, the order of all my research subjects has changed.
The decrypted discs, pillow books aren`t now anymore down the list, but more in the middle.

It is now a little bit confusing.

Researchable living people are now mixed with items in the research list.

Thanks.
Reported to Yankes.
« Last Edit: September 08, 2018, 08:32:52 am by Meridian »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1684 on: September 08, 2018, 08:54:12 am »
The game now checks, if research topics exist on many places... and if not, either crashes on start or writes errors in the log file and skips non-existing research... please check the log file.
That explains it, but it causes major problems for my mod. I have a lot of items that require a research project that doesn't exist. If it did exist, you could access the items in random battles. Previously, the only way to lock items out of random battles was to assign them a research project that didn't exist. Now, there is no way to do it.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1685 on: September 08, 2018, 09:14:58 am »
That explains it, but it causes major problems for my mod. I have a lot of items that require a research project that doesn't exist. If it did exist, you could access the items in random battles. Previously, the only way to lock items out of random battles was to assign them a research project that didn't exist. Now, there is no way to do it.

By random battles you mean "New Battle" mode? There, you should have access to all items... by design.

Anyway, the correct way to protect research/manufacturing/items you don't want to give direct access to is to protect them by a dummy research that is unobtainable (e.g. by requiring item that cannot be obtained in the game).

Example from piratez:

Code: [Select]
research:
  - name: STR_UNAVAILABLE
    cost: 0
    needItem: true

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1686 on: September 08, 2018, 11:19:13 am »
Sure, I can do that but it doesn't work in new battle mode, because there it automatically researches everything. I can't see how many points the mission gives because none of the alien artifacts are counted for points once researched.

Speaking of which, is there an alternate way to bypass that? I want all alien artifacts to continue yielding points even if they have been researched.

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1687 on: September 08, 2018, 05:01:25 pm »
I moved check for correct research because game waste lot of time to check every time if research exists. Another this was that you need run game and do lot of things to check if all your rules are correct and reference correctly each other.
Because of this I stared adding code that link all data after all mods are loaded, thanks to that game code is simpler and modder can start game only to verify if his mod is defined correctly.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1688 on: September 08, 2018, 08:23:57 pm »
I moved check for correct research because game waste lot of time to check every time if research exists. Another this was that you need run game and do lot of things to check if all your rules are correct and reference correctly each other.
Because of this I stared adding code that link all data after all mods are loaded, thanks to that game code is simpler and modder can start game only to verify if his mod is defined correctly.

Thank you.

I think it's great if the game is willing to go to all that trouble because it can help the modder discover errors, as long as it doesn't have to waste time checking. Or if it were a separate tool that the modder could use electively, then you could make it as thorough as you want.

But if a code error doesn't necessarily cause problems, then I think in most cases it's best to make the game allow it. You never know when someone will intentionally use the code error for their mod. Sometimes it ends up being a feature after all.

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1689 on: September 08, 2018, 09:16:39 pm »
Thank you.

I think it's great if the game is willing to go to all that trouble because it can help the modder discover errors, as long as it doesn't have to waste time checking. Or if it were a separate tool that the modder could use electively, then you could make it as thorough as you want.

But if a code error doesn't necessarily cause problems, then I think in most cases it's best to make the game allow it. You never know when someone will intentionally use the code error for their mod. Sometimes it ends up being a feature after all.
First of all why I did is was to simplify engine (and speed it up). Check for modders was a free bonus.
Old version us text to find references when needed (and doing this need look through every object of that type). Now one object have direct access to another (in some extreme cases it could be 1000 times faster) and because of that I can't disable "checks" it only thing I can is throw error or ignore completely that both will not work in your case.

Overall doing things like this is not wise because you really on things that are not expected by programmers and not supported. This worked only because it was "passive" list, when it become active (like I did) your mod will stop working. Other times its bug that will be fix in next version. In C++ something like that is named Undefined Behavior :>

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1690 on: September 08, 2018, 09:34:39 pm »
Yeah, don't hack... ask for a feature instead.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1691 on: September 09, 2018, 11:53:40 pm »
Yeah, don't hack... ask for a feature instead.

It doesn't seem like hacking to me. I don't see why I should be forced to make research projects for everything that requires one. If the player never encounters the research project, they simply are never able to use the item.

If it were a case of A calls for B then it would be problematic because once A were called, B would fail and the game would crash. But it's not. It's a case of A needs B. Since A never has B, A is permanently off. That's not hacking, it's basic programming.

To give another example:
If you have a suit of armor that exists only to make a UFOPedia article, it might not have a spritesheet that corresponds to it, and it also does not call one. If you tried to wear the armor onto the battlefield, it would attempt to call a spritesheet and fail, and the game would crash. But if you never wear it (because it's not available to the player) then it only ever has its inventory sprite called. Thus it's fine if the armor has no spritesheet as long as it doesn't call for one.

Now say you have an armor suit that has a spritesheet listed, but it doesn't link to anything in extraSprites, or the file isn't found. That would be a case where the game should alert the player to it at start, because the armor is already calling the spritesheet and failing to find it.


You COULD make all armors require a spritesheet, inventory sprite, and a corpse, but then you'd break every mod that has unusable armors that don't have those.

- - - - -
So, can I have a way to make alien artifacts yield points on recovery even if they have been researched?
« Last Edit: September 10, 2018, 12:01:32 am by The Reaver of Darkness »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1692 on: September 10, 2018, 12:03:32 am »
I don't know if you're a programmer... but that's far from basic programming.
In best case, it's neglecting of proper checking of user input.
In worst case, blatant disrespect for common sense.

Yes, you can have such option... do you want this also in the real game or only in the "New Battle" mode?

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1693 on: September 10, 2018, 12:15:19 am »
do you want this also in the real game or only in the "New Battle" mode?
Both, most importantly in the main game. But I do want the ability to deliver the "New Battle" experience the way I want others to receive it. I don't like not being able to enforce something in that mode just because of its default settings.

P.S.: I am not a programmer.

Offline DaveQB

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: [OXCE+] Original discussion thread
« Reply #1694 on: September 14, 2018, 10:25:59 am »
Just registered to say my thanks for the Android version. I tried an older version long ago but my phone wasn't much back then, and now that I got a new one and a stylus I couldn't but check again - I was confused at first because I didn't even know that OpenXcom website had changed domain a while ago. Great to see a new mod portal, too.

What I find most impressive, as the result of all the years of cumulative work since the first OXC release, is that all the improvements (like the indicators of how many Time Units will be left after moving to a certain tile) are so well integrated, they feel like they were always there.

I'd love to see a feature that allows to scale the Battlescape and the UI differently but, from a quick search, the idea has been considered loooong ago already but it was stated as very difficult to implement.