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.


Topics - The Martian

Pages: 1 2 [3] 4 5 ... 11
31
OXCE Support / [Solved] Debug Mode: Score?
« on: January 19, 2023, 11:09:27 am »
Is there a debug key that gives the player infinite score or something like that?

I did not spot one on the OpenXcom 'Debug mode' section of the UFOpaedia.org site.

Having to shoot down unrelated UFOs and deal with missions is eating up a lot of my time while I'm testing new code.

32
Help / Controlling UFO spawns?
« on: January 19, 2023, 10:49:15 am »
I've been trying to learn how the spawning of UFOs work but the exact method of controlling it is still escaping me.

To test this I've setup a small testing mod that has several races and also has all of the default alienMissions: and missionScripts: deleted. The regions: have also been altered to change the missionWeights: settings.

(Edit: Found the mistake in my code causing Cruisers to spawn. They still aren't spawning very often though.)
With that I thought I had it but the UFOs are not spawning correctly so I am missing something and despite setting all the alienMissions: to spawn only STR_SURVEY_SHIP I'm still getting Cruisers and the UFOs are also not spawning very often even though the waves: timer: was set to a low number.

Spoiler:


I'm not totally sure how missionScripts: 'recon' & 'invasion' work as they are mostly empty compared to the other entries:

Code: [Select]
  - type: recon
    firstMonth: 1
  - type: invasion
    firstMonth: 6

My theory is that 'recon' starts all UFOs spawning and 'invasion' is the same as 'recon' and that both will run at the same time doubling the amount of spawned UFOs starting at month 6.

The race of the aliens crewing the UFOs did not seem to change very often until I reduced the number of ships in each alienMissions:  waves: to 1. Is the race of the craft only selected when the beginning of a waves: starts and is then used for all the other ships that will appear in that wave?


Any help would be appreciated, what am I missing here?

33
Tools / Art Testing Kit
« on: December 23, 2022, 11:27:20 am »
[OpenXcom Extended version 7.5.7 or newer is required to use this mod] (Get OXCE 'HERE')


This mod is not built to be played, instead it is a tool for allowing quick access to all of the X-COM: UFO Defense drawing routines.

To use this tool select "New Battle" from the main menu then "Equip Craft" followed by "Armor".

You will find that there are now several new armors that can be equipped, these correspond to the various X-Com and Alien units.

Before the name of each armor is the drawing routine used for that sprite sheet, for example dR: 1 is drawingRoutine: 1 used by the alien Floater unit.

My hope is that this can save a bit of time as this mod's .png image files can quickly be swapped with your own sprite sheets to check how that unit will look while walking around ingame.

If your sprite sheet is a different height or width than the sprite sheet you are replacing it with then you also need to modify the extraSprites_ATK.rul file's code to match the new image size.

The values that need to be changed are width: & height: for the related entry in the [====] Units / Armors [====] section of the extraSprites_ATK.rul file.

For example if you wanted to swap the Muton.png sprite sheet with a new image file that has a size of of 512 by 720 you would need to change this code in the extraSprites_ATK.rul file.

Code: [Select]
  - type: ATK_MUTON.PCK
    width: 512
    height: 680
    subX: 32
    subY: 40
    files:
      0: Resources/Unit/drawingRoutine_10_Muton/Muton.png

So that the width & height variables matched your new file's image size:

Code: [Select]
  - type: ATK_MUTON.PCK
    width: 512
    height: 720 # <====
    subX: 32
    subY: 40
    files:
      0: Resources/Unit/drawingRoutine_10_Muton/Muton.png

There are also one and two handed weapons available at the top of the equipment menu:



Supported drawing routines are:
0 = Soldier, Sectoid
1 = Floater
2 = HWP
3 = Cyberdisk
4 = Civilian, Ethereal, Zombie
5 = Sectopod, Reaper
6 = Snakeman
7 = Chryssalid
8 = Silacoid
9 = Celatid
10 = Muton
11 = Coelacanth, Displacer
12 = Hallucinoid
14 = Lobster Man
16 = Bio-Drone
19 = Tentaculat
20 = Triscene
21 = Xarquid
22 = Inverted Cyberdisc (Propulsion animation on top)


Changelog:
(V1-8)
- Added drawing routine 20. (Triscene)

(V1-7)
- Added drawing routine 11. (Coelacanth & Displacer)

(V1-6)
- Added drawing routine 21. (Xarquid)

(V1-5)
- Added drawing routine 12. (Hallucinoid)
- Equipment HandOb images now display at the correct height. (Effected: Sectoid, Floater, Ethereal, Snakeman, Muton, Lobster man)

(V1-4)
- Added drawing routine 16. (Bio-Drone)
- Added a one handed and a two handed weapon.

(V1-3)
. Added drawing routine 14. (Lobster Man)

(V1-2)
- Prevented a crash when female X-Com soldiers used the Muton drawing routine. (Female torso frames added)
- Inventory is now allowed for all armors, however many aliens now share the X-Com Power Suit's inventory image as a place holder since they have none of their own.
- All armors can now hold equipment.

(V1-1)
- Added drawing routine 19. (Tentaculat)
- Included better instructions about mismatched unit sprite sheet heights and widths.

Download:
- Art Testing Kit V1-8
- Art Testing Kit V1-7
- Art Testing Kit V1-6
- Art Testing Kit V1-5
- Art Testing Kit V1-4
- Art Testing Kit V1-3
- Art Testing Kit V1-2
- Art Testing Kit V1-1
- Art Testing Kit V1-0

34
Help / A few questions about raceWeights:
« on: December 19, 2022, 06:07:52 am »
I'm trying to make every UFO potentially be crewed by a different set of aliens with an equal chance of any specific race being used.

At first I thought this could be achieved just by using raceWeights: but from what I've read the alien crew race can also be set to match the occupants of the base that launched it.

So as more alien bases are added to the map more non-randomized UFO crews will be generated.

I think that to prevent this the variable genMissionRaceFromAlienBase: can be set to false which will cause all UFOs to use the raceWeights: values to determine their crew instead of using the race of their origin base.

Spoiler:
Code: [Select]
alienMissions:

# [=] Example Mission [=]
  - type: STR_EXAMPLE_MISSION
    points: 0
    genMissionRaceFromAlienBase: false # <-- Now it will pick one of the four below options instead of the base's race
    raceWeights:
      0:
          STR_AQUATOID: 25
          STR_GILLMAN: 25
          STR_LOBSTERMAN: 25
          STR_TASOTH: 25
    waves:
      - ufo: STR_SURVEY_SHIP
        count: 1
        trajectory: P0
        timer: 9000
      - ufo: STR_ESCORT
        count: 1
        trajectory: P2
        timer: 7800
      - ufo: STR_CRUISER
        count: 2
        trajectory: P4
        timer: 9000

I'm unsure of exactly how raceWeights: functions though.

For example when making all aliens have an equal chance of spawning if there are ten different possible entries in the raceWeights: section do the combined values all need to add up to 100%?

Spoiler:
Code: [Select]
alienMissions:

# [=] Example Mission [=]
  - type: STR_EXAMPLE_MISSION
    points: 0
    raceWeights:
      0:
          STR_ALIEN_ONE: 10
          STR_ALIEN_TWO: 10
          STR_ALIEN_THREE: 10
          STR_ALIEN_FOUR: 10
          STR_ALIEN_FIVE: 10
          STR_ALIEN_SIX: 10
          STR_ALIEN_SEVEN: 10
          STR_ALIEN_EIGHT: 10
          STR_ALIEN_NINE: 10
          STR_ALIEN_TEN: 10
    waves:
      - ufo: STR_SURVEY_SHIP
        count: 1
        trajectory: P0
        timer: 9000
      - ufo: STR_ESCORT
        count: 1
        trajectory: P2
        timer: 7800
      - ufo: STR_CRUISER
        count: 2
        trajectory: P4
        timer: 9000

Or should they all be set at 50 for 50% chance of each race being picked?

Spoiler:
Code: [Select]
alienMissions:

# [=] Example Mission [=]
  - type: STR_EXAMPLE_MISSION
    points: 0
    raceWeights:
      0:
          STR_ALIEN_ONE: 50
          STR_ALIEN_TWO: 50
          STR_ALIEN_THREE: 50
          STR_ALIEN_FOUR: 50
          STR_ALIEN_FIVE: 50
          STR_ALIEN_SIX: 50
          STR_ALIEN_SEVEN: 50
          STR_ALIEN_EIGHT: 50
          STR_ALIEN_NINE: 50
          STR_ALIEN_TEN: 50
    waves:
      - ufo: STR_SURVEY_SHIP
        count: 1
        trajectory: P0
        timer: 9000
      - ufo: STR_ESCORT
        count: 1
        trajectory: P2
        timer: 7800
      - ufo: STR_CRUISER
        count: 2
        trajectory: P4
        timer: 9000

Also if each has a 50% chance wouldn't the entries higher on a list have more of a chance of being chosen then the lower ones as the coin toss would need to be lost by the previous entries before later ones are considered for their own shot at 50% odds?

35
Help / An alien unit that is always displayed at maximum light level?
« on: December 01, 2022, 01:59:57 pm »
I have an alien unit using "alwaysVisible: true" on its armor and it works, the alien unit can be seen by all friendly X-Com units and is displayed on the map.

However the alien unit's image is pitch black due to there being no light at its current location.

I'm hoping that it can be setup so that the unit renders as if it is in full daylight at all times.

For example Yankes's script to animate armor adjusted the colour on a darkened unit to make it glow briefly.
Code: [Select]
      recolorUnitSprite: |
        var int reg0;
        var int reg1;
        var int color;
       
        get_color color new_pixel;
        get_shade reg0 new_pixel;
       
        if or eq color COLOR_X1_PURPLE0 eq color COLOR_X1_PURPLE1;
          set reg1 anim_frame;
          wavegen_tri reg1 8 4 4;
          add reg0 reg1;
          limit_upper reg0 15;
          set_shade new_pixel reg0;
        end;
       
        add_shade new_pixel shade; #add environment shade
        return new_pixel;


36
OpenXcom Extended 7.5.7 (v2022-03-07)

I've noticed that if in units: the alien makes use of spawnUnit: and also has been setup to auto-surrender no live alien items are recovered in mission end loot screen if that alien auto-surrenders.

At least that appeared to be the case when I tested it in using the "New Battle" feature from the main menu.

Code: [Select]
    spawnUnit: STR_UNIT_NAME
    capturable: true
    canSurrender: true
    autoSurrender: true

Example:
Code: [Select]
# [====] Items [====]
items:


# [=] Alien Corpse [=]
  - type: STR_AQUATOID_CORPSE
    size: 0.4
    costSell: 20000
    weight: 30
    bigSprite: 46
    floorSprite: 42
    invWidth: 2
    invHeight: 3
    recoveryPoints: 5
    battleType: 11
    armor: 26
    listOrder: 901776
    recoveryTransformations:
      STR_AQUATOID_CORPSE: [1]
      STR_SONIC_BLASTA_RIFLE: [1]


# [=] Live Alien #1 [=]
  - type: STR_ALIEN_UNIT_1
    size: 0.0
    recover: true
    liveAlien: true
    costSell: 40000
    recoveryTransformations:
      STR_AQUATOID_CORPSE: [1]
      STR_SONIC_BLASTA_RIFLE: [1]


# [=] Live Alien #2 [=]
  - type: STR_ALIEN_UNIT_2
    size: 0.0
    recover: true
    liveAlien: true
    costSell: 40000
    recoveryTransformations:
      STR_AQUATOID_CORPSE: [1]
      STR_SONIC_BLASTA_RIFLE: [1]



# [====] Units [====]
units:


# [=] Alien Template [=]
  - &STR_AQUATOID_TEMPLATE_UNIT
    type: STR_AQUATOID_TEMPLATE_UNIT
    race: STR_AQUATOID
    rank: STR_LIVE_SOLDIER
    stats:
      tu: 54
      stamina: 90
      health: 30
      bravery: 80
      reactions: 63
      firing: 52
      throwing: 58
      strength: 30
      psiStrength: 35
      psiSkill: 0
      melee: 76
    armor: AQUATOID_ARMOR0
    standHeight: 16
    kneelHeight: 12
    value: 10
    deathSound: 50
    intelligence: 3
    aggression: 2


# [=] Alien Unit #1 [=]
  - type: STR_ALIEN_UNIT_1
    refNode: *STR_AQUATOID_TEMPLATE_UNIT
    armor: AQUATOID_ARMOR0
    spawnUnit: STR_ALIEN_UNIT_2
    stats:
      mana: 90
      tu: 90
      stamina: 90
      health: 90
      bravery: 90
      reactions: 90
      firing: 90
      throwing: 90
      strength: 90
      psiStrength: 90
      psiSkill: 0
      melee: 90
    capturable: true
    canSurrender: true
    autoSurrender: true
    builtInWeaponSets:
      - - STR_SONIC_BLASTA_RIFLE
        - STR_BLASTA_POWER_CLIP
      - - STR_SONIC_BLASTA_RIFLE
        - STR_BLASTA_POWER_CLIP
      - - STR_SONIC_BLASTA_RIFLE
        - STR_BLASTA_POWER_CLIP


# [=] Alien Unit #2 [=]
  - type: STR_ALIEN_UNIT_2
    refNode: *STR_AQUATOID_TEMPLATE_UNIT
    armor: AQUATOID_ARMOR0
    builtInWeaponSets:
      - - STR_SONIC_BLASTA_RIFLE
        - STR_BLASTA_POWER_CLIP
      - - STR_SONIC_BLASTA_RIFLE
        - STR_BLASTA_POWER_CLIP
      - - STR_SONIC_BLASTA_RIFLE
        - STR_BLASTA_POWER_CLIP


37
If someone has a method could you please convert the two attached images into their correct frame split for use with Drawing Routine 5 (Sectopod), it would be of great help.

Both images are in Falko's HWP template layout and use the Terror From The Deep palette format.


Spoiler:



It appears that Falko's Modding Tool site is down so sadly I can't make use of that excellent HWP tool.

He did upload his source files HERE ( falkooxc2.zip ), but unfortunately hwpbuild.html didn't just run when I opened the html file.


UnitSprite Studio looks like it has support for drawing routine 5 (Sectopod) but I can't run the program from this computer.


My other thought was to reverse the operation of Buscher's "Merge 2x2 Spritesheet Tool" so that it split images laid out in Falko's HWP template style instead of recombining them.

So far my python skills haven't been up to the task of making sense of merge_2x2_spritesheet.py enough yet to pull it off though.


My last resort is to slowly cut up the images by hand and match each frame to an existing split image for a Sectopod but I'm hoping to avoid that as it would be both difficult and extremely time consuming.

38
Help / How are the sprite sheets for bullet sprites laid out?
« on: May 14, 2022, 01:36:51 pm »
Could someone please explain the layout of the bullet sprite images?


How does this animate and how big is each frame?

What part is the bullet and what part is the trail that follows it?

39
Help / Limiting Artifact Site mission spawn rate in TFTD
« on: May 14, 2022, 01:27:25 pm »
I just finished the 12th Artifact Site in my current Terror From The Deep playthrough with no Port Attack, Island Attack or Shipping Lane Mission appearing in between the constant stream of Artifact Site missions.

In an effort to add some variety to missions I've been trying to break up the rate that Artifact Sites can be generated to allow for some standard alien terror missions to spawn as well.


For my first attempt I tried deleting the "artifacts" entry in missionScripts: and replacing it with twelve similar entries named:
artifacts_1
artifacts_2
artifacts_3
artifacts_4
artifacts_5
artifacts_6
artifacts_7
artifacts_8
artifacts_9
artifacts_10
artifacts_11
artifacts_12


Each of these new entries have a maxRuns: of 1 instead of 12 and are setup through firstMonth: to generate an Artifact Site every two months which will hopefully give the aliens a chance to spawn alternate missions in the month between the guaranteed Artifact spawns.

Unfortunately only artifacts_1 seems to run so this isn't working currently. I suspect it may have something to do with label: but I do not understand missionScripts: well enough to do more than guess.



Here is the code I'm working with:
Code: [Select]
missionScripts:

# [=] Remove old Artifact Site mission [=]
  - delete: artifacts


# [=] Artifacts Site #1 of #12 [=]
  - type: artifacts_1
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 6
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #2 of #12 [=]
  - type: artifacts_2
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 8
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #3 of #12 [=]
  - type: artifacts_3
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 10
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #4 of #12 [=]
  - type: artifacts_4
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 12
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #5 of #12 [=]
  - type: artifacts_5
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 14
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #6 of #12 [=]
  - type: artifacts_6
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 16
    executionOdds: 100
    startDelay: 0

# [=] Artifacts Site #7 of #12 [=]
  - type: artifacts_7
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 18
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #8 of #12 [=]
  - type: artifacts_8
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 20
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #9 of #12 [=]
  - type: artifacts_9
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 22
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #10 of #12 [=]
  - type: artifacts_10
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 24
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #11 of #12 [=]
  - type: artifacts_11
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 26
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #12 of #12 [=]
  - type: artifacts_12
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 28
    executionOdds: 100
    startDelay: 0

40
Work In Progress / [TFTD][WIP][OXCE] Zrbite Laser Rifle
« on: May 14, 2022, 12:49:48 pm »
A small mod that adds an additional weapon that can be researched by X-Com, the Zrbite Laser Rifle.


This weapon could prove useful when clearing out aliens during those long cargo ship or cruise ship missions as it can only be operated when above water.





This mod is not currently feature complete and lacks the following:
. Laser Firing Sound Effects.

Downloads:
. Zrbite Laser Rifle (V0-2)
. Zrbite Laser Rifle (V0-1)

41
OpenXcom Extended Version: 7.5.7 (v2022-03-07)

I've noticed that if I add maxRange: to a weapon and give it to an enemy unit they just stop moving when they come into sight range of an X-Com unit instead of closing the distance and firing.

Here is an example mod that makes all the alien weapons have a setting of maxRange: 9.
Test_maxRange.zip

Code: [Select]
items:

  - type: STR_SONIC_CANNON
    maxRange: 9

  - type: STR_SONIC_BLASTA_RIFLE
    maxRange: 9

  - type: STR_SONIC_PISTOL
    maxRange: 9

  - type: STR_DISRUPTOR_PULSE_LAUNCHER
    maxRange: 9

  - type: STR_THERMAL_SHOK_LAUNCHER
    maxRange: 9


This unit can see X-Com soldiers, and hasn't moved for 3 turns:
Spoiler:

There are other alien units in similar frozen states as well at the time of the screenshot which is where the
"Attack type=12 target=(24,18,0) weapon=STR_DISRUPTOR_PULSE_LAU..." debug message is most likely coming from.

Here is an even better example, If I reduce the maxRange: to 1 this unit is stuck in place and I can walk soldiers right up to it and it never tries to move forward:
Spoiler:

42
I noticed that if I try to make a unit leave no corpse by giving the corpse item a blank image for the FloorOb image it kind of works in that it can no longer be seen, but any other items on that tile are hidden behind the invisible corpse FloorOb.

Example, the cursor is over a corpse item FloorOb that is covering a stack of items:
Spoiler:

Example invisible corpse images for BigOb, FloorOb, HandOb:
Spoiler:




Is there a way that units can be setup to drop no corpse item on death?

43
In TFTD when using an incindiary weapon fire extinguishes when a turn passes if it is burning on the most commonly found tile on the ocean floor, but it will stay burning on most other tiles.

My guess is this is related to that map tile's configuration and not the weapon itself.

Is it possible to alter these tiles from a .rul file so that incindiary keeps burning, or is there another factor putting the fire out?



Gas Cannon fires an incindiary round:
Spoiler:

The next turn it is gone:
Spoiler:

44
Help / New alien race not spawning in UFOs when expected
« on: March 26, 2022, 01:04:14 am »
[OXCE Version: 7.5.7 (v2022-03-07)]

While learning the UFO controlling sections of OpenXcom's .rul files I've been trying to create a new alien race and have been using KiethSomataw99's Murmillo faction suggestion as a template. (The TFTD palette's limited amount of red can be a real pain at times.)

I have encountered a problem that I can't seem to get past, changing the code doesn't seem to produce any effect which makes me think that there is another option to control the race appearance rate that I need to configure or that my code incorrect.

The new units do work in "New Battle" mode from the main menu, however when I adjust the encounter rates in alienMissions: there seems to be almost no effect.

Even at 100% with all other races at 0% I still encounter just Aquatoids & Gillmen with the new race strangely absent.

At first I thought it wasn't working at all but after running a few missions with all races at 0% and the new race at 100% the new race spawned once... then back to Aquatoids & Gillmen for the next missions:

They spawned once (I haven't been able to get it to repeat since then) so 'something' was slightly working, just not as expected.

I'm attaching two .zip files to this post. One with the alienMissions: configured to 100% new faction encounter rate the other to a more balanced encounter rate, both seem produce the same results:
Test-New-Faction V0-1.zip (100% chance version)
Test-New-Faction V0-1.zip (Balanced chance of all races version)

45
OXCE Support Y-scripts / [Solved] Scripting 'isFuseEnabled'
« on: February 23, 2022, 05:52:11 pm »
I see that BattleItem.isFuseEnabled in the 'newTurnItem' section of the verbose openxcom.log allows for checking if the fuse is already active on an item, which sounds pretty useful.


I'm not sure how to define the Args it requires, could someone please post an example of the phrasing?
Code: [Select]
Name: BattleItem.isFuseEnabled                Args: [ptr BattleItem] [var int]                        Desc: check if fuse is triggered (like throw or proxy unit)
I was thinking that newTurnItem cycled through all items during a new turn and ran any scripts off each item, so the code in new_TurnItem: is phrased with the current item in the sequence as the subject of what the script is reading/writing, but then what is the var int that isFuseEnabled needs? I was expecting it to return a value not take one so I'm most likely not understanding this correctly.

What I'm trying for is something like this, if the grenade's fuse is not active run the code: (I know this code is incorrect, but I'm hoping it will show what I mean to accomplish.)
Code: [Select]
  scripts:
    newTurnItem:
      - offset: 52
        code: |
          if Battle_Item.isFuseEnabled STR_EXAMPLE_GRENADE = false;
            <CODE>
          end;




Additional question:
Am I correct in that all BattleItem, BattleGame, etc found in the openxcom.log file are phrased as Battle_Item and Battle_Game with an underscore dividing them when used in a .rul file's code for scripting?

Pages: 1 2 [3] 4 5 ... 11