Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Kzer-Za

Pages: 1 2 3 [4] 5 6 ... 10
46
OXCE Support Y-scripts / Re: Scripting basics
« on: August 26, 2019, 10:57:21 am »
I thought it should be in "units" because if I define it in "soldiers" I get an error. The rest of the code is the same as above, only "units" are replaced with "soldiers":

Code: [Select]
soldiers:
  - type: STR_SOLDIER
    tags:
      IS_SOLDIER: 1

Code: [Select]
[ERROR] Error in tags: 'IS_SOLDIER' unknown tag name not defined in current file

47
Released Mods / Re: Wounds proportional to damage [OXCE]
« on: August 26, 2019, 10:38:51 am »
Well, about ammo, I'm gonna give it a thought, but I have other things on my mind now.

In melee weapons it behaves exactly the same. If you want them to be more/less wounding you need to give them the tag. This is exactly why these ..._UNARMED items are there. Because in my personal changes to the game mechanics I have these "items" that allow soldiers and aliens to fight unarmed :) These unarmed attacks actully deal very minor damage, that is why I don't see the reason to release them as a mod. They are just for flavor, you can't actually beat anyone up except a civilian or a sectoid. And I also gave them that tag and specified that unarmed attacks don't cause wounds at all (they inflict minor damage, but even when you manage to deal more than 5 damage per hit, there still will be no wounds).

Quote
Would you recommend to give your tag to a weapon with low damage?

You mean, so that less damaging weapons would still inflict significant amount of wounds? Personally I see no reason, because I see it as this: if the weapon deals little damage, than it's less likely to inflict more wounds. As I said above, I even prevented (already low-damaging) unarmed attacks from inflicting wounds even when the amount of damage would allow it. But in your mod it's your choice.

48
OXCE Support Y-scripts / Re: Scripting basics
« on: August 26, 2019, 10:13:56 am »
But after the correction of the mistake above, I still get zeroes. Probably another stupid mistake on my part, but I don't see it :( Here's the code:

Code: [Select]
extended:
  tags:
    BattleUnit:
      LAST_HIT_FRAME: int
      IS_SOLDIER: int
  scripts:
    accuracyMultiplierBonusStats:
      - offset: 10
        code: |
          var int unitFloating;
          var int unitSoldier;
          unit.getTag unitSoldier Tag.IS_SOLDIER;
          debug_log 96580879 unitSoldier;
          return bonus;
units:
  - type: STR_SOLDIER
    tags:
      IS_SOLDIER: 1

And after clicking on a weapon in the Battlescape I get this in the log:
Code: [Select]
[26-08-2019_10-00-05] [DEBUG] Script debug log at     0x2d: 96580879 0

I can't see what am I doing wrong now.

49
Released Mods / Re: Wounds proportional to damage [OXCE]
« on: August 26, 2019, 07:18:39 am »
The script will just treat the weapon with this tag as "not special", as if it had no such tag. I inserted only a check for SPECIAL_WOUND=1, because any weapon that does not have this tag is gonna have this value equal to 0. So the check for 1 is simply to make sure that someone wanted this weapon to not use the amount of wounds calculated by this script.

You have some suggestions of using it for anything else?

50
OXCE Support Y-scripts / Re: Scripting basics
« on: August 25, 2019, 11:15:37 pm »
(Banging my head on the wall) I have copied it from somewhere and didn't change the type. Thanks!

51
OXCE Support Y-scripts / Re: Scripting basics
« on: August 25, 2019, 09:03:46 pm »
I would also like to have tags on soldiers as BattleUnits for other purposes, is there a way for it? As I said, neither

Code: [Select]
soldiers:
  - type: XCOM
    tags:
      SOLDIER: 1

nor

Code: [Select]
units:
  - type: XCOM
    tags:
      SOLDIER: 1

is working. (By not working I mean that when I try to get the tag, the result is 0).

52
OXCE Support Y-scripts / Re: Scripting basics
« on: August 25, 2019, 06:29:54 pm »
I think it would be better to create a separate theme for these questions for readability sake, since they are not related to scripting (mission scripts are a different kind of scripts, not the one discussed here).

PS I answered your questions briefly in a private message, to keep this theme about scripts.

53
Released Mods / Re: UFOpaedia-friendly Celatid [UNIT] [OXCE]
« on: August 25, 2019, 05:52:13 pm »
Ah, if I try to add an empty file, then the part with the X1.PCK looks like this:

Code: [Select]
extraSprites:
  - type: X1.PCK
    width: 1024
    height: 64
    subX: 128
    subY: 64
    files:
      96: Resources/UFOpaedia-friendly_Celatid/Blank.png

And I place the specified png to the specified location, of course.

54
Released Mods / Re: UFOpaedia-friendly Celatid [UNIT] [OXCE]
« on: August 25, 2019, 05:47:37 pm »
Well, I made only two changes to the code: inserted the piece from my previous message in the end of the file, and inserted hitAnimation in the item description like this:

Code: [Select]
  - &STR_CELATID_GEMMA
    type: STR_CELATID_GEMMA
    size: 0.1
    weight: 0
    power: 0
    damageType: 0
    battleType: 4
    blastRadius: 0
    hitAnimation: 96 # the inserted line
#    fixedWeapon: true
...

55
OXCE Support Y-scripts / Re: Scripting basics
« on: August 25, 2019, 05:41:06 pm »
Thanks, but how do I declare the variable for holding "getGeoscapeSoldier"? I tried this:

Code: [Select]
          var ptr BattleUnit isSoldier;
         
          unit.getGeoscapeSoldier isSoldier;
          if neq isSoldier null;
            debug_log 0 12345;
          end;

But I get an error "Conflicting overloads for operator 'clear'". If I try "var ptr GeoscapeSoldier isSoldier;", I get "invalid type" error.

56
Released Mods / Re: UFOpaedia-friendly Celatid [UNIT] [OXCE]
« on: August 25, 2019, 05:21:09 pm »
1. Maybe I'm doing something wrong, but it doesn't seem to be working. If I specify an empty X1.PCK like this:

Code: [Select]
extraSprites:
  - type: X1.PCK

the game just displays the same one-tile explosion as before. If I add a path to a non-existent file, it crashes. If I give it a transparent png I found on my computer, it crashes.

2, 3, and Yankes's suggestion: I would need sprites of these objects for it. And since anything I draw is not even half-decent, I can't make mods with graphics. Maybe if this mod actually finds some users, and one of them would be willing to contribute the graphics...

57
OXCE Support Y-scripts / Re: Scripting basics
« on: August 25, 2019, 07:41:37 am »
There is separate attack on psi-amp that do weapon damage. Aliens can use it too.

Really? Can I combine it with the regular attacks? I wanted Mind Control to inflict minor damage (say, 2-3 HP). It is insignificant from one attack, but with repeated attacks it would take its toll.

58
OXCE Support Y-scripts / Re: Scripting basics
« on: August 25, 2019, 07:35:27 am »
what do you want to do?

accuracy and damage can be modded to oblivion also without scripts, have you checked the existing ruleset attributes?

Yes, they can, but I want to give soldiers a penalty to accuracy when they are flying, and that does not seem to be doable without scripts. The script for reducing the accuracy is already working, here it is:

Code: [Select]
    accuracyMultiplierBonusStats:
      - offset: 10
        code: |
          var int unitFloating;
          var int unitSoldier;
          var ptr RuleItem itemRuleset;

          unit.isFloating unitFloating;
          if eq unitFloating 1;
            muldiv bonus 8 10;
          end;
         
          debug_log 1 bonus;
          debug_log 2 unitFloating;
         
          return bonus;

Now I only need to insert a check for whether a unit is a soldier or not, since I don't want to affect other flying units. (Since soldiers in flying suits are affected by not having a foothold, while for massive hovertanks and cyberdiscs it is not such an issue, and flying aliens should be adapted to it, since flying is their natural means of locomotion).

59
OXCE Support Y-scripts / Re: Scripting basics
« on: August 24, 2019, 11:07:27 pm »
How can I trigger accuracyMultiplierBonusStats only for soldiers? I tried using tags, but neither

Code: [Select]
soldiers:
  - type: XCOM
    armor: STR_NONE_UC
    tags:
      SOLDIER: 1

nor

Code: [Select]
units:
  - type: XCOM
    armor: STR_NONE_UC
    tags:
      SOLDIER: 1

works.

Also I would like it to apply to all weapons except psionic ones, and I can't get item rulesets from within accuracyMultiplierBonusStats. Could you advise something about it?

60
The engine doesn't work that way.

If you want the weapon to stay after ammo is spent... you must define a weapon and a separate ammo.

Okay, if it's impossible, it's impossible. But creating a weapon and a separate ammo does not seem to work, for "overheating" lasers at least. If the weapon does not have "compatibleAmmo", then I can manipulate its ammo directly from "createItem" and "newTurnItem" via "getAmmoQuantity" and "setAmmoQuantity". But if it has a "compatibleAmmo", then I need to use "getAmmoQuantity" and "setAmmoQuantity" on the clip, not on the weapon.

So, if I create a separate ammo for a weapon, I need to define its clip, and manufacture/buy these clips, and load them into the craft. Otherwise they are not in the craft, and I can't do anything about their ammo. Perhaps someone could suggest a workaround?

Pages: 1 2 3 [4] 5 6 ... 10