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

Pages: 1 [2] 3
16
Fuel for travel or “return” to the new base (if in flight) and living space for pilots (if enabled) need to be checked.
So not simple, but not really complicated, either.

17
Help / Re: Empty hand HWP?
« on: January 08, 2023, 07:30:51 pm »
Well, specialUseEmptyHand/specialUseEmptyHandShow are roundabout ways to reuse hand slot interface for “special” weapons. Hovertank just has one glued into a “hand” slot, it’s not defined as specialWeapon.
Thus you would need to unglue them, and presumably convert those guns from fixedWeapon to specialWeapon.
But since unit class does not have specialWeapon field to mess with, this seems to require either
  • give it a custom armor (instead of unified “HOVERTANK_ARMOR”) or
  • turn hovertanks from items that spawns as an unit into soldiers type individuals (as Buscher advised), at which point you can give them specialWeapon or just allow inventory.

18
OXCE Suggestions DONE / Re: [DONE][Suggestion] Instant xcom base defense
« on: January 04, 2023, 02:03:53 pm »
Happy New Year!
The "instant retaliation" name is probably confusing, I should have named it "instant xcom base defense".
Like… “sneak attack”?

It would do well with those surface base level mods. And a supply truck placed as “UFO”.  :D
In general, this mission does not work with bases, that is, with the "operationType: 1" function. It generates normally in a region with an alien base and an X-COM base. But it is also generated in other regions with X-COM bases.
Maybe there should be some generic mechanism to tell them apart?..
I mean, they search for a base only as a part of retaliation mission, and then… just forget about it and this does not affect their other operations?

19
OXCE Support Y-scripts / Re: [Suggestion] powerRangeIncrease
« on: January 03, 2023, 06:07:31 pm »
I see one thing that is missing from scripts, we do not expose range to `hitUnit` hook (you can check distance to other unit but it not always same).
I will look if I can add this.
hitUnit takes the current power and can adjust it as a variable, correct?
So negative powerRangeReduction does its thing, then on hit the script just caps it if it went above the threshold (presumably set in a tag). Or may even calculate range-by-trajectory from the current and ruleset power values, then apply its own damage (range) formula to the result.
The problem is, while hits to units can be controlled this way, how to handle hits to tiles?

20
OXCE Suggestions DONE / Re: [Documentation] Spawning Units from Items
« on: January 02, 2023, 05:53:03 pm »
Items that may be used to enable this behavior are:
  • Firearms that use themselves as ammo - lasers, single-shot launchers, etc.
  • Any ammunition for a firearm.
  • Melee weapons or melee attacks on any item.
  • Grenades and proximity mines.
  • Psi-amps.
So, things that count as “attacks”.

Well, it's still cool for bio-weapons, like apoc leech-cannons, alien proximity eggs, etc. look forward to seeing what people do with it
Mods use this for arbitrary spawns pre-placed on map as “grenades”. That could also be invisible and timed or toggling / unreliable, perhaps.
Hmm, maybe proxy mines as ambush / wildlife type spawns?
Doom spawn cubes / Half-life Nihilant’s teleports as “guns”…

Also, spawning does not interfere with the usual functionality (such as explosion, which goes off before the unit is spawned). I can only think of 2 uses: “splat! lol, telefrag” and special effects of “summoning in a puff of smoke” sort.

21
Help / Re: Spawning a small unit from a big unit
« on: December 31, 2022, 04:34:15 pm »
I meant an item can spawn an unit when it “explodes” via spawnUnit, and a corpse can explode (Cyberdisk style)…
can you provide an example?
I tried to quickly test it, but could not even make a hovertank corpse explode like cyberdisk, so probably slowpoked somewhere, will try again with clearer head.  :-\
(Edit:) Got that one, the weird 0×0 corpseGeo thing and specab in 2 places.

Can’t get spawning to work with non-attack items, however.
There does not seem to be a way to change BattleType in scripts?
Hmm. If it’s a pre-set ability for non-player unit, maybe just place a grenade type item in the inventory, and set the fuse in newTurnItem script? So it’s dropped on death, then goes off after the turn ends. If the unit is immune to stun, of course, or it can be dropped while it’s alive.

22
Released Mods / Re: Lightning replacement (Lightning 97 series)
« on: December 31, 2022, 12:15:54 pm »
"As an interceptor, it fails by having a short range, low speed and only one hardpoint. As a transporter, it is unable to carry Heavy Weapons Platforms and only has room for a small squadron of soldiers. These are the main reasons why a number of X-COM Commanders frown on the usage of the Lightning. "
https://www.ufopaedia.org/index.php/Lightning
One weapon, limited troops, high speed.
IMO, it’s supposed to be a scout-killer. In which role its limited range may be the worst flaw, the rest is acceptable. The enemy crew is also small.
You don’t really need fire support as much as scouting before Motion Detector stage, so it would still do better in a mod with small vehicles, just to fix the “walk out of the door, die” problem and scout around a bit.

23
Help / Re: Spawning a small unit from a big unit
« on: December 31, 2022, 08:30:29 am »
Spawn an item that becomes an unit?

24
Help / Re: Strike Carrier Mod
« on: December 31, 2022, 08:22:09 am »
A decent warship map would take enormous amount of terrain work (even in UFO:AI with no limitations of classic XCom compatible engine, and in Quake 3 formats).
Even a decent container ship map would take huge amount of work, but at least lots of stuff there would be reusable — from warehouses, industrial areas, etc.
Anyway, various ship maps could be cool indeed, but it’s more likely to happen in hybrid mods.

25
Help / Re: Learning to Mod
« on: December 31, 2022, 07:09:43 am »
I was told that I need to write a sub mod.
Mods have master ruleset (assigned in the metadata file), so yes. You could just test it on something in xcom1 vanilla, then change base item to whatever you want and edit master to x-piratez


  #*** Stat boosting ***
        code: |
There should be something like
Code: [Select]
extended:
  scripts:
    healUnit:
at the start.

  But I don't understand where should I start? Can you give me step by step instructions on what to do?
1. Create dummy ruleset: directory structure + metadata. …/MyMod/metadata.yml, …/MyMod/Ruleset, etc.
2. Edit your metadata.yml.
3. Create …/MyMod/Ruleset/scripts_item.rul or something, and write your script in there.
4. Enable your mod in mods menu.
5. It’s debug time! Since YAML based script is sensitive to things like number of spaces or where and how you commented out a line, the most likely result at this point is: OXCE terminated with a complain about some error in your ruleset. So look at the log, edit your mod, re-enable it (or just keep options.cfg open in another tab and keep saving it to overwrite)… repeat until it works. Then repeat until it works the way you want.

As to scripting as such… I did not find anything non-opaque on scripts, but over there Yankes pointed at “Script (OpenXcom)” Ufopaedia page. There’s a reference for things like data formats. Even better, it has links to the threads with actual script examples on this forum (at the bottom).

26
OXCE Suggestions OK / Re: [SUGGESTION] USO size accuracy modifier
« on: December 30, 2022, 08:11:09 pm »
You could tweak evasion (avoidBonus) for fine-tuning. It does all works linearly, much as it pains me to see probabilities added and subtracted like this.
Here you can see the code.
As to the differences in weapon performance, armor is damage reduction, so it weakens low-damage weapons relatively more.

27
OXCE Support Y-scripts / Re: [y-script] Script hooks
« on: December 30, 2022, 07:27:18 pm »
This helps, though needs some update.
However, one important detail the verbose log cannot give is when these scripts run.
It looks like when an unit provokes reaction, first the engine determines that reaction should happen, then scripts run in the order reactionWeaponAction (if the action was with a weapon), then reactionUnitAction, then reactionUnitReaction.
But when does selectItemSprite run? Apparently not just once when the item spawns, since it can be used to react on ammunition changes. Every time anything is done with an item? Every frame the item is on screen?..
It’s obviously important for FooBonusStats, too, and not obvious either.
And so on.

28
OXCE Suggestions DONE / Re: [Documentation] Soldier Skill Menu
« on: December 24, 2022, 05:26:52 am »
main function of script hook`skillUseUnit` is to determine if given action will execute

to see what exactly is available in scripts you should look in verbose logs where game dup all scripts with all its meta data.
Old copy of list of all hooks can be find in https://www.ufopaedia.org/index.php/Script_(OpenXcom)
Thanks. The links to examples from that page helped, too.
So, this script runs before the action itself, mostly as free-form validation, any follow-ups would need to use other hooks somehow. It could adjust stats for the soldier or item involved, but then resetting them will be very tricky… unless doing this on new turn is acceptable (if it is, a special tag could be set, to be checked in newTurnUnit / newTurnItem).
While checking hands is trivial — the item is given as a pointer that can be compared to output of actor.getLeftHandWeapon and actor.getRightHandWeapon, much like in Vampiric item script.
Are my conclusions correct?

29
Help / Re: Comment Out A Avariable
« on: December 23, 2022, 02:56:30 am »
All fields must have some meaningful value. But usually you only need to set values for fields that actually matter in your ruleset.
If it’s a changed object, whatever was not redefined in your mod will retain values from the master ruleset where the object was first defined.
If a field was not assigned values in any ruleset, it will have default (hardcoded) value. Most of them are not set anywhere, indeed. I mean, just look at the huge list The Martian linked. With 4 ammunition slot per weapon, customized damage types, etc. With vanilla ruleset it just works on defaults.

30
Help / Re: A few questions about raceWeights:
« on: December 22, 2022, 11:13:53 pm »
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.
...
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.
It’s a Deployment  (Alien Mission) property, rather than global. Otherwise yes: if the given mission has genMissionRaceFromAlienBase: true and raceWeights: are defined, it will use weights, otherwise copy from base.
I'm unsure of exactly how raceWeights: functions though.
Weights are relative, so p = W(this)/ΣW(all).
If all weights add up to 100, then it is the same as percentages. If they add up to something else, corresponding portion is considered.
So [0, 50, 35, 15] adds up to 100 and corresponding chances are 0/100, 50/100, 35/100 and 15/100 = 0%, 50%, 35% and 15%.
Similarly [1, 1, 1, 1] adds up to 4 and corresponding chances are 1/4, 1/4, 1/4 and 1/4 = 25%, 25%, 25% and 25%.
…and if you want percents, you don’t need to do normalize these numbers after every tweak, just when you are finished adjusting them. So, less bother for everyone.
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%?
You do not have to, but may find it more transparent if Weights are readable as % (or ‰) of frequency.

Pages: 1 [2] 3