Author Topic: Open Modding Question Thread  (Read 854 times)

Offline The_Funktasm

  • Colonel
  • ****
  • Posts: 133
  • Trust furries, not aliens
    • View Profile
    • My very curse-heavy blog.
Open Modding Question Thread
« on: November 20, 2018, 02:54:08 pm »
Feel free to use this thread for your own questions. I remember a useful thread on the zdoom forums like this.


Hi, I have no idea what I'm doing with half of modding OpenXcom. A specific area I've had trouble with is the aliens. I have figured out player units well enough but haven't figured out how to really accomplish certain goals I have.

If anyone could explain a few of these things to me I would really appreciate it.



1/Setting equipment and equipment status (such as pre-priming of explosives) for aliens, and whether this can be done by race.

2/ As an aside of the above, ensuring aliens actually USE equipment in their inventory aside from their primary weapon. (if all that works are grenades and firearms then that is fine. I don't expect use of proxies or indirect fire, or medical kits.)

3/ Creating subtypes of existing aliens (have done a little bit of it) and giving them their own alien mission preferences and tendencies.
An example of this is that I somewhat want to have different social/class groups of ethereals. One specifically favoring abductions and infiltration. They would have slight stat differences and carry different loadouts. Another example would be Muton terror units that have a sort of psionic or pharmaceutical boost they're on and wield light plasma weapons and alloy blades or claws. These are just examples, the mechanics are what I'm interested in right now thought.

4/ Creating aliens that are XCom units with lightly modified sprites, as in enemy human combatants.

5/ Creating specialized civilians, including ones with weaponry. I realize that the default civilians do not have the means to wield weaponry. The intent would be to further customize any "missions" I might attempt to make if I can figure out map creation. A concept is that special missions could serve to diversify the more repetitious parts of the game. Special missions would be the hoops XCOM has to jump through to maintain funding. These would include the sort of operations you'd expect governments waving money to offer a shadowy paramilitary organization but at least generally oriented toward project safety, secrecy, and anti-infiltration and base-installation missions.

6/ As an aside to most of this, assistance in the creation of fake civilian corpses for the creation of more reasonably "in-progress" terror site maps. I have always found the aliens and xcom's "turn 1 agreement" weird.


If you could give me some tips or point me in the right direction on a few of these I would really appreciate it. I am used to a somewhat unrealistic standard of documentation due to the ZDoom engine.
« Last Edit: December 21, 2018, 02:58:37 am by The_Funktasm »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4777
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: More diverse and focused Alien Missions/Teams
« Reply #1 on: November 20, 2018, 03:45:25 pm »
I'll just say what is doable and what not... for help/examples, try Discord maybe for live help... these questions are rather vague and and also too complex to provide sample solution... instead I would recommend looking at existing big mods, how they did it and take inspiration from there.

1/
You can set equipment only by alien deployment, not by race.
You can work around this by having only one race use specific deployment.
Or when using OXCE, there are a few more ways to override deployment, e.g.
Code: [Select]
ufos:
  - type: STR_MEDIUM_SCOUT
    raceBonus:
      STR_SECTOID:
        craftCustomDeploy: STR_CUSTOM_SECTOID_DEPLOYMENT
      STR_MUTON:
        craftCustomDeploy: STR_CUSTOM_MUTON_DEPLOYMENT
There are similar overrides for mission sites and alien bases too.

Pre-priming of explosives is not possible.

2/ That's completely up to AI, you can't influence that... if they decide to use them, they will.

3/ Sure, most modders already done that in their mods.

4/ No problem.

5/ Yes, possible.

6/ Yeah, either put them into the map blocks directly; or spawn them as items.

Offline The_Funktasm

  • Colonel
  • ****
  • Posts: 133
  • Trust furries, not aliens
    • View Profile
    • My very curse-heavy blog.
Re: More diverse and focused Alien Missions/Teams
« Reply #2 on: November 20, 2018, 04:23:37 pm »
Thank you for the info and answers.

Ah. Being unable to pre-prime explosives is a small disappointment. I don't suppose I can set a custom explosion or item to spawn on death for aliens, can I?

I had wanted to have some tricky enemies that either explode on death or drop proximity weapons to simulate booby-trapped corpses. It seemed like a fitting tweak for a more cannon fodder terror unit, or special subtypes of aliens for base invasions and other high-importance missions. (destroying the body would generally destroy the explosive, assuming it could be spawned, meaning they could be balanced to a degree still.)

Also, as far as "ensuring enemies use equipment" can't I kind of tip the scales with minor stat variations among aliens? I would assume an alien with different stats would favor different weapons because different "ideal" numbers would pop up for accuracy, etc.

Come to think of it, I had long thought aliens had incredibly simple behavior in regards to inventory. I figured they only could 1: fire their in-hand weapon, 2: throw one grenade in their inventory, and 3: reload their in-hand weapon.

What can they actually do? Will the AI swap weapons, even if only rarely?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4777
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: More diverse and focused Alien Missions/Teams
« Reply #3 on: November 20, 2018, 04:52:28 pm »
It's not supersmart either, as far as I know:
- it is capable of using both melee and ranged weapon when both are equipped
- when two ranged weapons are equipped, it uses the one with less (snapshot) TU cost
- it doesn't consider weapon stats for accuracy... remember vanilla only ever had firing accuracy affect weapon accuracy
- it switches to another weapon after the first one is spent
- grenades, psiamps, blasters, etc. are handled separately

Offline The_Funktasm

  • Colonel
  • ****
  • Posts: 133
  • Trust furries, not aliens
    • View Profile
    • My very curse-heavy blog.
Re: More diverse and focused Alien Missions/Teams
« Reply #4 on: November 20, 2018, 05:30:21 pm »
Ok, so there is at least an amount that it'll work. I was worried about giving aliens too much equipment because it could be considered free if it's never used.

I may have to do some AI tests just to see what all actually assists aliens in combat.

My current mod is a bit too easy, and otherwise badly balanced.



Another few questions...

1/ If a weapon lacks non-burst firemodes, will an alien still fire the weapon?

2/ Can an alien be given an in-built(like terror units/melee) weapon and a traditional/hand weapon?

3/ And a question out of pure curiosity, primarily... Can a civilian unit be a 4 tile tank-style unit?

I hope I'm not being a burden or anything.
« Last Edit: November 20, 2018, 05:35:59 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4777
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: More diverse and focused Alien Missions/Teams
« Reply #5 on: November 20, 2018, 05:38:41 pm »
1/ aliens should be able to shoot with any fire mode... they can however reaction-fire only with a snapshot

2/ yes

3/ I never tried it, but it should work

Offline The_Funktasm

  • Colonel
  • ****
  • Posts: 133
  • Trust furries, not aliens
    • View Profile
    • My very curse-heavy blog.
Re: More diverse and focused Alien Missions/Teams
« Reply #6 on: November 20, 2018, 05:59:13 pm »
So theoretically I could have a "civilian" HWP that functions similarly enough to an XCOM one? That's something I wasn't really planning on but it could make missions more interesting.




Offline Hobbes

  • Commander
  • *****
  • Posts: 3405
  • Infiltration subroutine in progress
    • View Profile
Re: More diverse and focused Alien Missions/Teams
« Reply #7 on: November 21, 2018, 02:10:04 am »
3/ And a question out of pure curiosity, primarily... Can a civilian unit be a 4 tile tank-style unit?

Yes. You can even add aliens as civilian units. Any unit defined in units.rul can be spawned as a hostile and/or civilian. You can also use XCom soldiers this way if you add them to units.rul
« Last Edit: November 21, 2018, 02:16:22 am by Hobbes »

Offline The_Funktasm

  • Colonel
  • ****
  • Posts: 133
  • Trust furries, not aliens
    • View Profile
    • My very curse-heavy blog.
Re: More diverse and focused Alien Missions/Teams
« Reply #8 on: November 22, 2018, 02:24:44 pm »
As far as OXCE+ features I'm guessing that poking around the forums and looking at existing mods is still the best source of information for newer ones?

I have recently committed to an engine switch after finding out about additional damage types.

If I ever were to request any more features I'd do well to know what the game can't already do. (an example: aside from a single use arcing weapon that doesn't use throwing skill, how would I code a grenade that can either only be primed and thrown, or just thrown if priming involves turn-based delay no matter what if not proximity-based for detonation)

Essentially if I end up developing an XCOM vs mislead civil uprisings, or XCOM and rebels vs alien accomplices set of missions or logic to my mod, I feel molotovs would fit better than cheap grenades for their thrown additional weaponry. Planning on having this for both mods, normal and tftd and having research or other progress that prevents at least some of it.

Like, I am not sure but I would find diversity in base invasions a bit interesting and for a human military as an alien puppet to deploy against bases, or probing assaults of weaker craft from them or aliens on bases to be more interesting than very samey "invasion ships" that attack bases. They could happen as often with weaker probing raids before, perhaps?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4777
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: More diverse and focused Alien Missions/Teams
« Reply #9 on: November 22, 2018, 06:06:38 pm »
1/ The main OXCE+ thread contains a changelog. Not great, but better than nothing. Forum search can also help a bit... or just ask around. Existing mods also showcase tons of new features.

2/ If you were to request a feature, just make sure to describe what you want to use it for... I don't accept features without a use case/scenario...
... because most of the time there are better solutions, or even existing solutions.

3/ Also, I strongly prefer making new features for established modders. I don't make features for completely new people (generally speaking, not addressing you directly), who didn't try modding yet and are just letting their imagination loose... such features either never get used, or hurt the engine more than what they're worth.
There's tons of features available already, I suggest working on your mod with the features that are already available; and after you find out that you like this sh*t and want to dedicate non-negligible time to it, we can talk about requests.
« Last Edit: November 22, 2018, 06:19:08 pm by Meridian »

Offline The_Funktasm

  • Colonel
  • ****
  • Posts: 133
  • Trust furries, not aliens
    • View Profile
    • My very curse-heavy blog.
Re: More diverse and focused Alien Missions/Teams
« Reply #10 on: November 30, 2018, 04:38:18 pm »
1/ The main OXCE+ thread contains a changelog. Not great, but better than nothing. Forum search can also help a bit... or just ask around. Existing mods also showcase tons of new features.

2/ If you were to request a feature, just make sure to describe what you want to use it for... I don't accept features without a use case/scenario...
... because most of the time there are better solutions, or even existing solutions.

3/ Also, I strongly prefer making new features for established modders. I don't make features for completely new people (generally speaking, not addressing you directly), who didn't try modding yet and are just letting their imagination loose... such features either never get used, or hurt the engine more than what they're worth.
There's tons of features available already, I suggest working on your mod with the features that are already available; and after you find out that you like this sh*t and want to dedicate non-negligible time to it, we can talk about requests.

Yeah, I found a page that is incomplete on the wiki, and even that has answered a few questions I've had up to now, including that of the molotovs.

As far as feature requesting I would definitely do so. I understand how as a developer you can't just make more work later on down the line (what with adapting old code to new code when related things are updated or replaced) by taking up requests or adding things of questionable utility or use. I am also used to the common presentation that people in the zdoom community do for their feature suggestions; generally an example that'd work with the feature in-place or a long description of the finer use of said feature.


So, I do have a question again... What is the extent one can modify or add function to the psi-amp while keeping its primary vanilla functions intact? If I wanted to give it a more traditional "attack" with damage, would I pretty much have to hijack the melee attack? I kind of want to put psychic attacks in in general to balance out psychic aliens.

(good example for why: if there are less overtly "wipe out your whole squad" level psychic enemies initially, they both set the player up to think they aren't a big deal and prepare the more wary players for the actually high ranked ones.)

A minor second question also: is there a method to have weapons with finite, integrated ammo that do not get consumed or disappear when emptied?


And one last thing: No offense taken on the thing about established modders. I may have a mod already but it's in resources for a reason. Compared to most of the big mods out I kind of have more faith in it being useful as a pack of assets than a standalone mod at this point. I have a hell of a lot of work to do.




EDIT:
Is there any method one can use to make attacks that do not have LOS or projectile logic at all? What I mean is an attack that targets like the mind probe or psychic attacks and only requires the unit to be visible in the battlescape to at least one allied unit. Ideally this could have a succeed/fail chance rather than traditional accuracy.
« Last Edit: December 21, 2018, 03:00:43 am by The_Funktasm »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1606
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: More diverse and focused Alien Missions/Teams
« Reply #11 on: December 28, 2018, 06:15:27 pm »
EDIT:
Is there any method one can use to make attacks that do not have LOS or projectile logic at all? What I mean is an attack that targets like the mind probe or psychic attacks and only requires the unit to be visible in the battlescape to at least one allied unit. Ideally this could have a succeed/fail chance rather than traditional accuracy.

Yes, this is possible using OXCE where psi-amp-type items can have any combination of "Use" (create an attack on the target on success), "Panic", and "Mind Control" actions. You can see an example of this in the X-Com Files mod with the Staff of Heart Grip.

Offline Nord

  • Commander
  • *****
  • Posts: 767
  • The Gate will open... someday.
    • View Profile
Re: More diverse and focused Alien Missions/Teams
« Reply #12 on: December 28, 2018, 07:36:51 pm »
So, I do have a question again... What is the extent one can modify or add function to the psi-amp while keeping its primary vanilla functions intact? If I wanted to give it a more traditional "attack" with damage, would I pretty much have to hijack the melee attack? I kind of want to put psychic attacks in in general to balance out psychic aliens.
Like this:
Spoiler:
#Psi Attack Segment
    psiAttackName: STR_MC_ATTACK
    dropoff: 0
    hitAnimation: 46
    accuracyUse: 10
    accuracyMultiplier:
      psiSkill: 0.25
    damageType: 5
    powerRangeReduction: 3
    damageBonus:
      psiStrength: 0.5
    damageAlter:
      RandomType: 6
      ArmorEffectiveness: 0
      ToArmor: 0
      ToWound: 0
      ToMorale: 2.0
Quote
(good example for why: if there are less overtly "wipe out your whole squad" level psychic enemies initially, they both set the player up to think they aren't a big deal and prepare the more wary players for the actually high ranked ones.)
Dont forget that each  alien unit with psi skill>0 got special weapon, called "ALIEN_PSI_WEAPON", which allows them to panic or control your soldiers.
Quote
A minor second question also: is there a method to have weapons with finite, integrated ammo that do not get consumed or disappear when emptied?
Sadly no. Only way is to make special ammo packs with enormous reload time (like 999 tu), so recharge will be possible only on mission start.

Offline Yankes

  • Commander
  • *****
  • Posts: 2066
    • View Profile
Re: Open Modding Question Thread
« Reply #13 on: December 28, 2018, 11:08:13 pm »
In OXCE you can change or remove this "ALIEN_PSI_WEAPON" by unit property `psiWeapon` (empty mean removing it).

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4777
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Open Modding Question Thread
« Reply #14 on: December 29, 2018, 12:01:22 am »
In OXCE you can change or remove this "ALIEN_PSI_WEAPON" by unit property `psiWeapon` (empty mean removing it).

In OXC too :P