aliens

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 - memmaker

Pages: 1 ... 5 6 [7]
91
OXCE Support Y-scripts / [Examples] More Y-Script examples
« on: January 07, 2020, 07:52:42 pm »
So, I've been working on some ModScripts for OXCE+ and wanted to share what I have so far.

I am actually aiming for some documentation of the various scripting possibilities but did not yet find the time to write something meaningful. So examples will have to do for know.

I will start of with two of my debug scripts which I used for some damage scaling and understanding how XCOM applies damage. (See attached file debug.rul)

I am using two hooks which are part of the hit and damage calculations: hitUnit and damageUnit.

Both are called in quick succession after each other, every time a unit will potentially receive damage.

The first hook (hitUnit) receives power, part and side and is expected to also return these values. So we have the opportunity to change the power of an attack, the body part which was hit or the side of the armor where the hit connected.

The second hook (damageUnit) has variables for all the damage that is applied after a succesful hit (like to_health, to_armor, to_stun, etc.). Here you can change the amount of damage that is applied to the respective type.

One potential use of this would be a weapon which enables for body part targeting. I have included such an example as bodypart_targeting.rul.

We define three new Tags: AUTO_IS_KNEESHOT, AUTO_IS_ARMSHOT & AUTO_IS_HEADSHOT. When applied to a gun, the scripts will check for that tag on the weapon and apply fatal wounds to the bodypart which has been targeted.

(My meal is getting cold, so I will add more information later..;)

92
OXCE Support Y-scripts / Re: Boosting stats for a turn
« on: December 22, 2019, 02:22:23 am »
Thanks for the reply. It really helped. I added the setters myself in a fork. Learned a lot today.  8)

93
OXCE Support Y-scripts / Re: Boosting stats for a turn
« on: December 21, 2019, 05:14:24 am »
Psi-amp USE attack work similar to normal weapon, and normal weapon can alter unit state (not stats!) in any way you want on hit.
AFIK piratez do this with banner that boost morale. Overall you need lean how to write small scripts that you add to ruleset to fully implement this.

btw this is in OXCE, OXC do not have any way do this.

So, I am trying to get this to work. Namely having a a script executed by the Psi-Amp Use Action. I tried the damageUnit and hitUnit hooks but neither seems to trigger when activating the Use action. Any ideas on how this could be accomplished?

Code: [Select]
items:
  - type: STR_SKILL_AMP
    size: 0.1
    costSell: 194700
    weight: 10
    bigSprite: 33
    floorSprite: 32
    handSprite: 88
    hitSound: 36
    battleType: 9
    twoHanded: false
    invWidth: 1
    invHeight: 3
    tuUse: 1
    costUse:
      time: 1
    accuracyUse: 100
    accuracyMindControl: 100
    accuracyPanic: 100
    flatRate: true
    psiAttackName: STR_USE_SKILL
    scripts:
      hitUnit:
        - offset: 35
          code: |
            debug_log "Skill Amp Was Used!"
            return;

94
OXCE Support / Introduction of myself, Code feedback & questions
« on: December 16, 2019, 01:32:49 pm »
(Hope this board is the right place to post. If not, please move.)

Hi everyone, thanks for this place.

I really like the enthusiasm and spirit here. Also I really respect how much work and love has been put into this old game in order to keep it alive and enhance it.

My first UFO Defense playthrough was finished last week with OXCE as the engine. I had a blast.

So I grabbed my MacBook today (I already know that the X-Piratez Author does despise Apple and I thus cannot play his Mod on my Machine..;P) and downloaded the OXCE source repository in order to browse the code a bit.

And again I am impressed. I was able to compile and launch the project on my second try and it just works.

When reading the source I was pleasently surprised to find it neatly structured and using OOP paradigms, also the UI code looks quite modern and understandable.

Also the space-walkie-talkie and Leeroy comments had me smiling while reading more than once.

Still trying to understand some of the particularities of the code base and thought I might ask some questions here:

Is there some kind of big picture documentation for the source code? I know that the folders already tell a good story and most filenames are self-explanatory, but I wonder if there may be some conventions or concepts I should be aware of while browsing the code.

I found some state-changing code in a class called SavedBattleGame (e.g. fire/smoke spreading), so I guess this class is not just for the savegames (as I first assumed from the name) but does some grunt work for the world space?

Every meaningful state change is accomplished via an Action object instance? Is this true for all states?

I just found the class BattlescapeGame where some really interesting stuff seems to happen. For a quick test I modified the TU cost of the kneel action.

Thanks for all the great work, so that other people like me can have a look and learn and maybe even contribute ourselves.

95
XPiratez / Re: [MAIN] XPiratez - K2 - 2 Nov - Ice Ice Cool
« on: December 15, 2019, 03:13:20 pm »
Count me in. I'd like a link for the download, too.
Sharing is caring  ;D

Pages: 1 ... 5 6 [7]