Author Topic: memmaker's wishlist  (Read 5998 times)

Offline memmaker

  • Captain
  • ***
  • Posts: 96
    • View Profile
memmaker's wishlist
« on: January 23, 2020, 10:48:15 am »
So I will drop this here in order to find out which of these features might one day become reality and which ones would get flagged as "Never ever" by our Devs. I am also interested in helping the implementation, if I am able to.

So here we go:
Code: [Select]
# memmaker's oxce/modscript wishlist:
# - Ability to change the map from scripts
# - Ability to overlay tiles with bitmaps/animations from scripts
# - Ability to count visible units from scripts (eg. BattleUnit.getVisibleUnits.getLength)
# - Script Hook for missed shots? I want to know when a soldier fired but didn't hit his target.
# - Script Hook for movement? I want to know if a soldier has moved this turn or not.
# - A reference to the current weapon being used in the accuracyMultiplierBonusStats hook
# - Which faction's turn is it? Expose TURN_SIDE or sth. on BattleGame.
# - Ability to spawn units and items at will from scripts
# - A submenu on soldier transformation screens?
# - Allow specialWeapon on soldiers (currently only possible on armor)
# - Force explosions/fire/smoke from scripts
# - Force a unit to move from scripts
# - Force a unit to fire from scripts
# - Force a unit to use an item from scripts
# - Enable changing armor during missions
# - Enable scripts to make aliens forget XCOM units, effectively reverting being spotted and making the concealed again.
# - getUnitById, getItemById, etc. for scripts
# - A switch for the PSI_AMP to allow targeting friendly units.
# - A better way to define general use actions (preferably also more than one per item) than to use a self-targeting medikit.
# - Allow scripts to display text messages in the battlescape

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: memmaker's wishlist
« Reply #1 on: January 25, 2020, 12:27:58 am »
# - Ability to count visible units from scripts (eg. BattleUnit.getVisibleUnits.getLength)

I would need check if value is stable (when set it will not change unit some important game event happends)



# - Script Hook for movement? I want to know if a soldier has moved this turn or not.

We already have this in saner functionality, we can easy expose this to scripts.



# - A reference to the current weapon being used in the accuracyMultiplierBonusStats hook

This need some digging through some layers of code



# - Which faction's turn is it? Expose TURN_SIDE or sth. on BattleGame.

Doable



# - A submenu on soldier transformation screens?

Question for Meridian



# - Allow specialWeapon on soldiers (currently only possible on armor)

Doable, but what exactly you want grain doing this? Btw you can probably have different armors for each soldiers type based on same item.



# - Ability to spawn units and items at will from scripts
# - Ability to change the map from scripts
# - Ability to overlay tiles with bitmaps/animations from scripts
# - Force explosions/fire/smoke from scripts

Need lot of work to make script map-aware



# - Force a unit to move from scripts
# - Force a unit to fire from scripts
# - Force a unit to use an item from scripts

This is probably outside that scripts should do, unit movment require pushing new state but this can be very easy illegal.



# - Enable changing armor during missions

In long term possible (but only 1x1 => 1x1 or 2x2 => 2x2), there is concern how exactly handle stats transitions when armors have very different bonuses.
One solution I see it to use zombification but without killing solider, this mean unit after will have 100% stats.



# - Enable scripts to make aliens forget XCOM units, effectively reverting being spotted and making the concealed again.

Probably doable



# - getUnitById, getItemById, etc. for scripts

Probably doable



# - Script Hook for missed shots? I want to know when a soldier fired but didn't hit his target.
# - A switch for the PSI_AMP to allow targeting friendly units.
# - A better way to define general use actions (preferably also more than one per item) than to use a self-targeting medikit.

On one of my stashed branches I did some preliminary changes to allow handling actions by scripts, but I stumbled on deciding how exactly this scripts should look like and what capabilities should have (should have possibility to inform AI why he cant use weapon?)



# - Allow scripts to display text messages in the battlescape

How exactly? There is couple of interpretations of this and each have different difficulty level.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: memmaker's wishlist
« Reply #2 on: January 25, 2020, 01:02:21 am »
I can comment on a couple of these that are already doable with a combination of scripts and other features:

  • Spawning units by scripts: you can spawn a unit when an action causes some form of hit animation with OXCE's spawnUnit parameter on the item's ruleset. If the item is say, a grenade or a proximity mine, then scripts can determine when it explodes and spawns the unit. This is already in use in at least one mission in 40k to add enemy reinforcements to a battle in progress.
  • Force a unit to move: I have some WIP code that again expands on what happens when a weapon hits something that allows for some arbitrary movement of units. My plan is to have it be configurable enough to handle things as varied as grappling hooks, teleporters, jumping over fences, and knockback/recoil from weapons. It's probably not as versatile as what you'd want in a script, but the implementation is simpler.
  • Submenu for Soldier Transformations: Again I have WIP code for this, haven't had time to clean it up.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: memmaker's wishlist
« Reply #3 on: January 25, 2020, 01:30:36 am »
Force a unit to move: I have some WIP code that again expands on what happens when a weapon hits something that allows for some arbitrary movement of units. My plan is to have it be configurable enough to handle things as varied as grappling hooks, teleporters, jumping over fences, and knockback/recoil from weapons. It's probably not as versatile as what you'd want in a script, but the implementation is simpler.
But this is not more like instant teleportation that normal unit move with all its consequences? Because there big difference, placing unit in other place is barely in scope of scripts, full movement is outside.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: memmaker's wishlist
« Reply #4 on: January 25, 2020, 01:46:16 am »
It's fancy teleportation under the hood, only full updates (lighting, visibility, reactions, etc.) are done at end point of the movement.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: memmaker's wishlist
« Reply #5 on: January 25, 2020, 01:53:37 am »
It's fancy teleportation under the hood, only full updates (lighting, visibility, reactions, etc.) are done at end point of the movement.

"reactions" <- this could be problematic, when we can do it? probably not during next turn transition.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: memmaker's wishlist
« Reply #6 on: January 25, 2020, 02:12:01 am »
It's not handled by script, it's a state that runs on/instead of explosion state. So it handles like the end of a projectile action in terms of reactions. Unit acts, gets moved to new position, reactions check at new position.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: memmaker's wishlist
« Reply #7 on: January 25, 2020, 02:28:28 am »
If it will be only possible on "exposion" then ok.

Offline memmaker

  • Captain
  • ***
  • Posts: 96
    • View Profile
Re: memmaker's wishlist
« Reply #8 on: January 25, 2020, 07:02:01 am »
  • Spawning units by scripts: you can spawn a unit when an action causes some form of hit animation with OXCE's spawnUnit parameter on the item's ruleset. If the item is say, a grenade or a proximity mine, then scripts can determine when it explodes and spawns the unit. This is already in use in at least one mission in 40k to add enemy reinforcements to a battle in progress.
I am not sure I get the technique you describe in the fullest. Does this offer more fine grained control than throwing a spawning grenade/having an AI throw them/placing them via MapScripts?
Quote
  • Force a unit to move: I have some WIP code that again expands on what happens when a weapon hits something that allows for some arbitrary movement of units. My plan is to have it be configurable enough to handle things as varied as grappling hooks, teleporters, jumping over fences, and knockback/recoil from weapons. It's probably not as versatile as what you'd want in a script, but the implementation is simpler.
  • Submenu for Soldier Transformations: Again I have WIP code for this, haven't had time to clean it up.
Can't wait to see your efforts come to life ;)

Quote from: Yankes
# - Script Hook for missed shots? I want to know when a soldier fired but didn't hit his target.
# - A switch for the PSI_AMP to allow targeting friendly units.
# - A better way to define general use actions (preferably also more than one per item) than to use a self-targeting medikit.

On one of my stashed branches I did some preliminary changes to allow handling actions by scripts, but I stumbled on deciding how exactly this scripts should look like and what capabilities should have (should have possibility to inform AI why he cant use weapon?)

The scripts must not be complicated to begin with. Even a "void func()" would help as long as we had more hooks to get into and especially a generic USE hook. I believe the correct stuff to go in there can only be found by experimentation and the first use cases.

Quote
# - Allow specialWeapon on soldiers (currently only possible on armor)

Doable, but what exactly you want grain doing this? Btw you can probably have different armors for each soldiers type based on same item.
Would allow for stuff like built-in items / weapons on a soldier type base. Skills/Cybernetic Enhancements/Genetic Augmentations.

Quote
# - Allow scripts to display text messages in the battlescape

How exactly? There is couple of interpretations of this and each have different difficulty level.

Again, I think a simple solution would be far better than no one. And it can always be expanded upon.
What about the red flashing messages? Could they be used as flash messages with a timer?

I will also add my latest ones here ;)

Code: [Select]
# - A script hook allowing for on thy fly changing of action TU costs
# - A dialogue system for interaction with factions in the geoscape
# - Statstrings depending on tags

wcho035

  • Guest
Re: memmaker's wishlist
« Reply #9 on: January 25, 2020, 09:02:56 am »
In regards of your dialogue system with other factions, this is high up in my wish list. However, how are you going implement it? For what purpose?

You can’t have allied factions in the game, 3 different sides in battlescape missions.

You can’t make alliances or have UFO fighting other UFOs.

Perhaps you can do trade..


Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: memmaker's wishlist
« Reply #10 on: January 25, 2020, 02:18:53 pm »
I am not sure I get the technique you describe in the fullest. Does this offer more fine grained control than throwing a spawning grenade/having an AI throw them/placing them via MapScripts?Can't wait to see your efforts come to life ;)

No, this is more workaround, you place item that can spawn item on explosion, and you can alter fuse of this grenade to alter final result.

The scripts must not be complicated to begin with. Even a "void func()" would help as long as we had more hooks to get into and especially a generic USE hook. I believe the correct stuff to go in there can only be found by experimentation and the first use cases.

Problem is that its hard to make first simple version and then expand it without risk of breaking changes.
If we choose wrong it could hinder further development of script hook capabilities.
Another thing I would like know beforehand what script hook should have limitations and interaction with rest of engine.

This slow whole process down but make script more secure (its very hard to crash game using them) and stable (lot of mods already relay on them).

Simply crating new hook is creation of new contract between game and modders that they can do.

Would allow for stuff like built-in items / weapons on a soldier type base. Skills/Cybernetic Enhancements/Genetic Augmentations.

For now you can use soldier specific armors from same item, as it more ruleset change I think I could push decision on Meridan.

Again, I think a simple solution would be far better than no one. And it can always be expanded upon.
What about the red flashing messages? Could they be used as flash messages with a timer?

This could be done as it reuse most of functionality already present.


I will also add my latest ones here ;)

Code: [Select]
# - A script hook allowing for on thy fly changing of action TU costs
# - A dialogue system for interaction with factions in the geoscape
# - Statstrings depending on tags

# - A script hook allowing for on thy fly changing of action TU costs

Scripts should not be able to alter TU cost on fly, to many logic is liked to that and will make mess with code if you would want correctly implemented this.
Any way it could be only done is add to battle unit (or item) filed with multiplier for actions costs. This will have limitation but will be stable and hard to break.
AI would easy plan ahead correctly and if script would change it could kill unit too.


# - A dialogue system for interaction with factions in the geoscape

This is not scripts but full separate game mechanic that is probably outside scope of OXCE at least for me.


# - Statstrings depending on tags

you already doing this, answering it is pointless now :>

Offline memmaker

  • Captain
  • ***
  • Posts: 96
    • View Profile
Re: memmaker's wishlist
« Reply #11 on: January 25, 2020, 02:56:32 pm »
Nice. Thank you, Yankes, for this overview. I will re-iterate.

Code: [Select]
# memmaker's oxce/modscript wishlist:

== concept work needed (Yankes has done some work)
# - Script Hook for missed shots? I want to know when a soldier fired but didn't hit his target.
# - A switch for the PSI_AMP to allow targeting friendly units.
# - A better way to define general use actions (preferably also more than one per item) than to use a self-targeting medikit.

== doable
# - Script Hook for movement? I want to know if a soldier has moved this turn or not.
# - Which faction's turn is it? Expose TURN_SIDE or sth. on BattleGame.
# - Allow scripts to display text messages in the battlescape
# - A submenu on soldier transformation screens? (ohartenstein23 has done some work)

== probably doable
# - Ability to count visible units from scripts (eg. BattleUnit.getVisibleUnits.getLength)
# - A reference to the current weapon being used in the accuracyMultiplierBonusStats hook
# - Enable changing armor during missions
# - Enable scripts to make aliens forget XCOM units, effectively reverting being spotted and making the concealed again.
# - getUnitById, getItemById, etc. for scripts
# - Allow specialWeapon on soldiers (currently only possible on armor)

== hard work
# - Ability to change the map from scripts
# - Ability to overlay tiles with bitmaps/animations from scripts
# - Ability to spawn units and items at will from scripts
# - Force explosions/fire/smoke from scripts

== outside of scope / not feasible / not wanted / maybe too much work
# - Force a unit to move from scripts
# - Force a unit to fire from scripts
# - Force a unit to use an item from scripts
# - A dialogue system for interaction with factions in the geoscape
# - A script hook allowing for on thy fly changing of action TU costs

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: memmaker's wishlist
« Reply #12 on: May 26, 2023, 02:02:04 pm »
Code: [Select]
# - Ability to change the map from scripts

Any insight towards this? I wonder, if not with YS, but is it ever doable without losing your mind to actually change the map after it's generated? I mean, now tiles only can alter to either door mechanic, or death mechanic, and that's it. There is now way to slap another, say, craft map block without making tons of checks to not clip tiles and units. Or maybe I'm just too scared to attempt?   ;D