[MOD] Miscellaneous IZ Combat Tweaks

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
iWARR
Posts: 69
Joined: Mon, 10. Aug 15, 15:11

Post by iWARR »

(For the future inventions). Why attacked ship stays static? Splits doesn't sick on "Tetanus". Yeah?

This is smth. you like to code (I guess). Lets cure it.
Assume the ship has last command: "Waiting". In any dangerous situation it have to start moving and do maneuvers (as agressor does).
After the battle, it just back to the same position. Simple and cool.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

iWARR wrote:(For the future inventions). Why attacked ship stays static? Splits doesn't sick on "Tetanus". Yeah?

This is smth. you like to code (I guess). Lets cure it.
Assume the ship has last command: "Waiting". In any dangerous situation it have to start moving and do maneuvers (as agressor does).
After the battle, it just back to the same position. Simple and cool.
Hi iWARR, please send me a save from right before this happens, if you managed to keep one. This will allow me to take a closer look at what's happening.
User avatar
iWARR
Posts: 69
Joined: Mon, 10. Aug 15, 15:11

Post by iWARR »

w.evans
You can reproduce this situation easely. Just send your capship "Fly to (dangerous) zone..." It shoud fly and will be waiting. Set Defence Officer to "Attack". That's it. Just wait and have fun.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

iWARR wrote:w.evans
You can reproduce this situation easely. Just send your capship "Fly to (dangerous) zone..." It shoud fly and will be waiting. Set Defence Officer to "Attack". That's it. Just wait and have fun.
Ah, they won't attack unless they have an attack or patrol order. Split captains will attack without this order, but only if they are assigned to escort another ship. This is as intended since it makes it possible to coordinate attacks. Otherwise, ships will immediately attack threats when spotted, and will potentially do so, and be defeated, one by one.

If you want ships/squads to attack immediately upon reaching a zone, give them a patrol order, then select the zone where you want them to go.
User avatar
iWARR
Posts: 69
Joined: Mon, 10. Aug 15, 15:11

Post by iWARR »

Simple. If ship or squad "Waiting" (doesn't move) and someone begins attack it, then ship (squad) start moving and fighting (do maneuvers). Then returns in the same place and "Waiting" as before.
Is it clear?
Last edited by iWARR on Tue, 18. Aug 15, 16:20, edited 1 time in total.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

iWARR wrote:Simple. If ship or squad "Waiting" (doesn't move) and someone begin attack it, then ship (squad) start moving and fighting (do maneuvers). Then return in the same place and "Waiting" as before.
Not so simple, because "waiting" could mean that the ship's crew is running any of several scripts, NONE of which are directly modified by MICT. Could go in each and every one of the vanilla scripts and add an attack if attacked order, but since this is really something that the vanilla scripts have a problem with, I don't intend to. In any case, if the ship has an active attack or patrol order, or if they're escorting, they're running MICT and WILL attack if attacked. Otherwise, they're running vanilla.
User avatar
iWARR
Posts: 69
Joined: Mon, 10. Aug 15, 15:11

Post by iWARR »

I see. You don't touch Vanilla scripts for the crew. OK.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

iWARR wrote:I see. You don't touch Vanilla scripts for the crew. OK.
Only very specific ones, and only under very controlled circumstances, yes.
User avatar
iWARR
Posts: 69
Joined: Mon, 10. Aug 15, 15:11

Post by iWARR »

I'm not a coder, but:
1. Remember coordinates
2. Change status from "Wait" to "Attack" + MICT
3. Restore coordinates and change order for moving to 1-st position
4. Restore order "Wait".

Script for the 4 main Commands: Remember Coodinates -> Attack (MiCT) -> Check for new order (mission complete) -> Fly to position... (restore coordinates)
Last edited by iWARR on Tue, 18. Aug 15, 16:41, edited 1 time in total.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

iWARR wrote:I'm not a coder, but:
1. Remember coordinates
2. Change status from "Wait" to "Attack" + MICT
3. Restore coordinates and change order for moving to 1-st position
4. Restore order "Wait".
Hi iWARR, yeah, that looks logically workable. Problem is how the ai scripts are structured. I do like how it's structured, however, crew actions are subdivided into different scripts depending on particular crew, and their particular general action. So, for example, a capship captain who is escorting, then decides to follow his commander to a different zone, then finds a hostile target to attack would go through several scripts:

move.escort -> move.generic -> move.nohighways ->move.escort -> fight.attack.object -> move.attack.object.capital

move.undock is also often in there between several steps to make absolutely sure that the ship isn't docked.

Note that those are all separate scripts, and ALL of them have wait nodes. If I were to change behavior for just that particular sequence of events, to make the ship fight back when attacked at any particular point, I'd have to go in and change all of them. To change behavior for every time a ship waits, that's yet more scripts. Doable, but will require a lot of testing, could be unstable, and this mod probably won't be compatible with many other mods.

Like I said, it's doable, but I actually prefer how it is now. I habitually set all of my combat ready squads to patrol if I want them to respond to threats. I hardly ever use the "Fly to" command unless I explicitly want them to sit and wait.
User avatar
iWARR
Posts: 69
Joined: Mon, 10. Aug 15, 15:11

Post by iWARR »

attacked at any particular point
No. Only if THIS "waiting" ship is UNDER attack.
All that you have already + MANEUVERS (not static). That's it.
---------
Well, may be Vanilla will have new futures for AI. It's just for the future improvements.
Last edited by iWARR on Tue, 18. Aug 15, 17:01, edited 1 time in total.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

iWARR wrote:
attacked at any particular point
No. Only if THIS "waiting" ship is UNDER attack.
All that you have alredy + MANEUVERS (not static). That's it.
Yeah, but like I said, ALL of the movement scripts have ships set to wait at one point or another. There is no single wait script. To get ships to attack when fired upon whenever they wait, will have to go into all of those scripts, analyze them in detail to make sure that attacking won't break anything, and change accordingly.

What's wrong with issuing a patrol command instead of a fly to command?

edit: Also, if this is done, all ships will stop and fight when fired upon. If, for example, you want a ship to ignore targets and just go somewhere, that will no longer be possible. Right now, both are possible:

If you want a ship to engage hostiles when detected, issue a patrol command.
If you want a ship to ignore hostiles and just go somewhere, issue a fly to command.

edit 2: forgot to add, defence officers set to attack will fire on any hostile ships within range, regardless of what the captain is doing. This is a vanilla feature, however.
User avatar
iWARR
Posts: 69
Joined: Mon, 10. Aug 15, 15:11

Post by iWARR »

Some benefits:
- You can leave Ships to guard in concrete dengerous place (ships doesn't go far away)
- You may leave (forget) some ships for some time at present place if you have smth. more important.
- You can provide 2 battles at once.
- Increased ships lifetime and more smart battle-style

etc.

"Forgotten" ships will guard ourself and wouldn't be destroyed in 120 sec.
User avatar
iWARR
Posts: 69
Joined: Mon, 10. Aug 15, 15:11

Post by iWARR »

you want a ship to ignore targets
If plasma already is "on the fly", my ship (standing at one place) wouldn't ignore it. It will firing back, but die more quickly if wouldn't start moving.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain »

These from you? Seeing a lot of errors with drones too in the debug log

Code: Select all

[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Property lookup failed: this.station.trueowner
* this.station == null
* Expression: this.station.trueowner != faction.player or @this.$config_attackenemies
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Evaluated value 'null' is not of type component
* Expression: this.station
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Property lookup failed: this.station.maxcombatrange
* this.station == null
* Expression: this.station.maxcombatrange.all * (0.5f + (this.skill.combat + this.skill.leadership)f / 20f) + this.station.size / 2f
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Property lookup failed: this.station.size
* this.station == null
* Expression: this.station.maxcombatrange.all * (0.5f + (this.skill.combat + this.skill.leadership)f / 20f) + this.station.size / 2f
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Error evaluating <event_gravidar_has_scanned> event object: Value 'null' is not of type component
* Expression: this.station
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Error evaluating <event_object_attacked> event object: Value 'null' is not of type component
* Expression: this.station
[General] ======================================
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

BlackRain wrote:These from you? Seeing a lot of errors with drones too in the debug log

Code: Select all

[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Property lookup failed: this.station.trueowner
* this.station == null
* Expression: this.station.trueowner != faction.player or @this.$config_attackenemies
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Evaluated value 'null' is not of type component
* Expression: this.station
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Property lookup failed: this.station.maxcombatrange
* this.station == null
* Expression: this.station.maxcombatrange.all * (0.5f + (this.skill.combat + this.skill.leadership)f / 20f) + this.station.size / 2f
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Property lookup failed: this.station.size
* this.station == null
* Expression: this.station.maxcombatrange.all * (0.5f + (this.skill.combat + this.skill.leadership)f / 20f) + this.station.size / 2f
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Error evaluating <event_gravidar_has_scanned> event object: Value 'null' is not of type component
* Expression: this.station
[General] ======================================
[General] ======================================
[=ERROR=] Error in AI script fight.attack.object.station on entity 0x10429f2: Error evaluating <event_object_attacked> event object: Value 'null' is not of type component
* Expression: this.station
[General] ======================================
They're all because the station blew up, and it doesn't know it yet. Kinda like a Myrdraal.

And nope, I don't think they're caused by either MICT or MOCT.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

I think this is not possible because if an object is destroyed so are all entities on it and their scripts are killed. If this was on a station and didn't change location this.station should always be valid

Do you have any guess which entity this was? And maybe use any mods which may change the location of NPCs? To me this reads like either the script was used on a non-station NPC or that an NPC running this script from a station was moved somewhere else
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

UniTrader wrote:I think this is not possible because if an object is destroyed so are all entities on it and their scripts are killed. If this was on a station and didn't change location this.station should always be valid.
My thoughts exactly. So it's correctly an error message because someone's running the Station DO script, but isn't on a station.

Except is the NPC, and the NPC's script, dying instantaneous? Is it possible that there's a delay between the station dying and the script terminating? Or the DO's a Myrdraal.
UniTrader wrote:Do you have any guess which entity this was? And maybe use any mods which may change the location of NPCs? To me this reads like either the script was used on a non-station NPC or that an NPC running this script from a station was moved somewhere else
Also, I believe that scripts are aborted when NPCs are called back to the Skunk? (Can't remember for sure. Was a while back.) If so, then the DO must have been transferred some other way. Might help narrow it down.
Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp »

UniTrader wrote: Do you have any guess which entity this was? And maybe use any mods which may change the location of NPCs? To me this reads like either the script was used on a non-station NPC or that an NPC running this script from a station was moved somewhere else
I guess recent candidates from Conquest and War in Rebirth! mod would be the new CV system for making stations, and/or outposts based on the PMC Overwatch (which I could imagine isn't a proper station in the regular sense).
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

19.August 2015 - Miscellaneous IZ Combat Tweaks updated to v0.30

OOZ Battle Display shortened to 7 lines from 9.
Font fix by UniTrader for Rufont. Those playing with RU-localization should now actually see the UniBar! (Thanks, Uni!)

I don't think there are any other changes, but it's been busy here, and my last update was two days ago, so there might be some undocumented changes.

Can't test the localization fix without switching languages on my game, and sorry, but no time for that right now. Reports on whether it's working, or if it isn't, would be appreciated.

Oh, and looks like the RU UniBar's purtier than the non-RU UniBar.

Return to “X Rebirth - Scripts and Modding”