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

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [EXE] OpenXcom Extended
« Reply #1125 on: January 28, 2017, 04:59:28 pm »
Did you see that enemy change look when hit?

To be honest, I did not. I expected to see something like this, and I've seen the colours change, but I couldn't link it to events that happened. I thought the unit changed colour after being targeted with cursor, but it didn't seem quite right. Only after you explained that it changed colour after being hit I could see it happening, but it's not obvious at all.

This will allow:
You can have visual feed back when you do damage to unit (it will flash read for second if you do more than 1% damage)
Force field will flash when it block damage
Custom dead animations based for kill weapon

Yes, these are all useful effects to have. I'm especially interested in the last one.

How is these effects achieved? With scripts or ruleset settings?

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3350
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1126 on: January 28, 2017, 05:29:16 pm »
by script, that was hole point :)
For simply recoloring you need add one script and mark weapons witch color use to paint unit/corpse.
Overall goal is you add one script or two and then using `tags:` like it was builtin ruleset settings.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1127 on: January 28, 2017, 05:48:37 pm »
Hey Yankes, perhaps you could make a thread in this sub-forum to post examples of scripts with a description of what they do? I think it would be helpful if we had a compilation of scripts so modders can either copy-paste what functionality they want into their mod or get an idea of how to write their own scripts. For example, we could start with your night vision items, animated flying sprites, and hit indication scripts, and I have one to change weapon sprites based on ammo loaded.

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3350
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1128 on: January 28, 2017, 05:50:48 pm »
Hey Yankes, perhaps you could make a thread in this sub-forum to post examples of scripts with a description of what they do? I think it would be helpful if we had a compilation of scripts so modders can either copy-paste what functionality they want into their mod or get an idea of how to write their own scripts. For example, we could start with your night vision items, animated flying sprites, and hit indication scripts, and I have one to change weapon sprites based on ammo loaded.
Good idea, if you want right now some example are include in readme file.

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3350
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1129 on: January 29, 2017, 04:00:32 pm »
New version 3.6 is ready:

Config for new lighting system.
New map script options made by ohartenstein23.
New scripts for items and units.
Add option for grenades to explode in hand.
Changes in handling items with prime.
Primed grenades are not recoverable if consumable property is set.

Offline HelmetHair

  • Colonel
  • ****
  • Posts: 360
  • He who laughs last thinks fastest.
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1130 on: January 29, 2017, 08:52:59 pm »
Could you elaborate what config for lighting system means?

I'm very curious, as the lighting system/ night vision systems are very cool and I think there is still a whole lot more development to be done that area.


Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3350
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1131 on: January 29, 2017, 09:03:07 pm »
Could you elaborate what config for lighting system means?

I'm very curious, as the lighting system/ night vision systems are very cool and I think there is still a whole lot more development to be done that area.
On/off and some limits for performance.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1132 on: January 30, 2017, 04:24:29 pm »
Hey Yankes (and for Meridian too), I realized I forgot to update my documentation in Extended.txt when I re-did the alternate terrain code to use only vanilla map script commands - here's a link to a commit updating the documentation to reflect the changes.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 9092
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1133 on: January 30, 2017, 07:52:13 pm »

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3350
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1134 on: January 30, 2017, 08:04:59 pm »
Because you can now animate whole item HandOb sprite in inventory and on battle screen. To made both run on same pace I need adjust it in inventory.
If it too much off putting then I could tweak it a bit to restore original behavior.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 9092
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1135 on: January 30, 2017, 08:08:20 pm »
Because you can now animate whole item HandOb sprite in inventory and on battle screen. To made both run on same pace I need adjust it in inventory.
If it too much off putting then I could tweak it a bit to restore original behavior.

Don't know... just noticed it immediately after upgrading... let me play with it for a few days, maybe I'll get used to the new one quickly.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1136 on: January 31, 2017, 02:57:31 pm »
Hey Yankes, I have a question about item ruleset tags in scripts - when I initialize an int variable in a script without setting a value to it, then use getTag on a weapon ruleset to get a value, what does it default to when the weapon is missing that tag?  That is, can I check to see if the variable got a tag value with something simple like this?
Code: [Select]
If neq variableWithTagValue 0
... # continue with rest of script if tag exists on weapon

Edit: Nevermind, I checked it and it works fine like that.  Another question though - how do I get the proper mod offset for handobs?  There's a function to get the offset for bigobs and floorobs, but not for handobs.

More Edit:  Sorry for all the questions, but I ran into another issue with re-selecting the sprites for a weapon handob.  Is there a way to check whether or not the weapon is being fired when re-selecting the sprite with selectItemSprite?  I'm working on a script that changes the sprite based on loaded ammunition, but when firing a two-handed weapon, the sprite for turning the weapon from the 'held' to the 'firing' position remains in the 'held' position, so it looks like my soldier is firing out the side of the gun.

Even More Edit: Ah, sprite_offset handles all of the handob direction stuff.  Got the previous question figured out then, and I used rules.getSpriteOffsetBigobs for the mod offset for handobs - will that have any unintended consequences?
« Last Edit: January 31, 2017, 07:42:41 pm by ohartenstein23 »

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3350
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1137 on: January 31, 2017, 08:08:42 pm »
Hey Yankes, I have a question about item ruleset tags in scripts - when I initialize an int variable in a script without setting a value to it, then use getTag on a weapon ruleset to get a value, what does it default to when the weapon is missing that tag?  That is, can I check to see if the variable got a tag value with something simple like this?
Code: [Select]
If neq variableWithTagValue 0
... # continue with rest of script if tag exists on weapon

Edit: Nevermind, I checked it and it works fine like that.  Another question though - how do I get the proper mod offset for handobs?  There's a function to get the offset for bigobs and floorobs, but not for handobs.

More Edit:  Sorry for all the questions, but I ran into another issue with re-selecting the sprites for a weapon handob.  Is there a way to check whether or not the weapon is being fired when re-selecting the sprite with selectItemSprite?  I'm working on a script that changes the sprite based on loaded ammunition, but when firing a two-handed weapon, the sprite for turning the weapon from the 'held' to the 'firing' position remains in the 'held' position, so it looks like my soldier is firing out the side of the gun.

Even More Edit: Ah, sprite_offset handles all of the handob direction stuff.  Got the previous question figured out then, and I used rules.getSpriteOffsetBigobs for the mod offset for handobs - will that have any unintended consequences?
sh***, very big fail on my part not adding handob offset function :/ This will be first thing I will add to 3.7, same for aiming status.

This offset function are separate because each graphic set can have different number of graphic that belongs to base mod. If you use wrong one It could select incorrect graphic from set.

[ps]
If you want you can grab commits with missing functionality:
https://github.com/Yankes/OpenXcom/commit/1b872dd22fc84f6b0cad82033bdb4e5e6922e3c9
https://github.com/Yankes/OpenXcom/commit/122d749fdd330d00b15e2bcc66ba7a3af4f1489e

« Last Edit: January 31, 2017, 08:32:57 pm by Yankes »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1138 on: January 31, 2017, 09:51:10 pm »
When are newTurnItem and createItem scripts run?  I can see tags set by newTurnItem in a saved game, but only at the beginning of turn 2, not at the start of a battlescape instance, and I can't see any tags set by createItem in the save file at all.

Edit:  I have another question too - when I use a newTurnItem script, item is a ptre pointer to a BattleItem - how is this different from a ptr, and is there a way to use item.getTag?  Right now I get an error in my log file saying that getTag only works on ptr's to BattleItems, not ptre's.
« Last Edit: January 31, 2017, 10:12:18 pm by ohartenstein23 »

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3350
    • View Profile
Re: [EXE] OpenXcom Extended
« Reply #1139 on: January 31, 2017, 11:25:41 pm »
I will probably release bug fix version :/ Again I forget call `createItem` script in code. Sorry again for that, and I very thankful for your testing.

`newTurnItem` is call for each change of current fraction, e.g.

xcom turn, newTurnItem, alien turn,  newTurnItem, neutral turn, newTurnItem, xcom turn, ... etc.

`createItem` should be called before battle when items are created.

same as similar unit functions.


`ptre` - is pointer to editable object
`ptr` - is pointer to readonly object
`getTag` should work on both, difference is `setTag` that only work on `ptre` because you change state of object.
Could you show error you get?