cease_fire not ceasing fire completely?!

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

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

Post Reply
oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

cease_fire not ceasing fire completely?!

Post by oliverjanda » Sun, 14. Jan 18, 20:30

Hi,
I'm playing with the following script but surprisingly the attackers don't cease fire completely:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<mdscript name="BoardingTargetProtector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<cues>
		<cue name="BoardingStarted" instantiate="true" namespace="this" version="100">
			<conditions>
				<event_boarding_triggered/>
			</conditions>
			<actions>
				<set_value name="$boardee" exact="event.param2"/>
			</actions>
		</cue>
		<cue name="ProtectBoardee" instantiate="true" version="100">
			<conditions>
				<event_object_attacked object="$boardee"/>
			</conditions>
			<actions>
				<do_if value="event.param != player.primaryship and event.param != @player.ship">
					<cease_fire object="event.param"/>	
					<stop_attack object="event.param" target="$boardee" />
					<debug_text text="event.param + ' ceasing fire'"/>
				</do_if>
			</actions>
		</cue>
		<cue name="BoardingEnded" checktime="5s" checkinterval="5s" version="100">
			<conditions>
				<check_value value="$boardee.boarder.exists" negate="true"/><!-- doesn't work -->
			</conditions>
			<actions>
				<cancel_cue cue="BoardingStarted"/>
			</actions>
		</cue>
	</cues>
</cue>
</cues>
</mdscript> 
The commander of the ship goes to "follow me" but the defense officer is still in "attack all enemies"....
Any ideas?

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Sun, 14. Jan 18, 21:38

thats because the Commands only reset the Target List and the DO fills it again every few seconds. See fight.defend.capital which Nonplayer-Capship DOs execute by default. Maybe signalling them to stop helps..

Code: Select all

 <signal_object object="event.param.defencenpc" param="'stop attack'"/>
Also messing with the Relationas in addition should help. otherwise the Ship stops attacking for a second, sees a "new" Enemy and starts attacking.. possibly even immediately because the Turrets are "by chance" all already perfectly aligned...[/code]
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 ;)

oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

Post by oliverjanda » Mon, 15. Jan 18, 09:58

I messed with the relations already: I set the Ship and NPCs to faction.friend (also tried faction.ownerless) but my ship continued firing.
the only thing that helped was setting the enemy to faction.player but that's not good for other reasons.

I'll definitly try to signal them to stop.

oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

Post by oliverjanda » Mon, 15. Jan 18, 20:51

@UniTrader
Your suggestions works fine for my capships even without changing relations.
Of course, it doesnt work for small ships. Any idea how this could be done?

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 15. Jan 18, 21:53

since they have no DO (pilot controls all ship functions) i guess maybe signal the pilot instead? just a guess into the blue though...
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 ;)

oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

Post by oliverjanda » Mon, 15. Jan 18, 22:47

that doesnt work, unfortunately.

I can cease fire for small ships by changing faction to ownerless.
in case of a failed boarding attempt, i have to reset the faction again though.

a side effect of "stop attack" is, that the capitalship stops attacking any target, not just the one being boarded.

I will do more tests (alos with attacking npcs) and probably upload it to the steam workshop later.

Thank you!

oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

Post by oliverjanda » Wed, 17. Jan 18, 09:10

changing faction to ownerless has the negative side effect that boarding is counted as crime and therefore decreases your relations to the policing faction. :/

I'm wondering if it is possible to set the hull of the boarded ship to a minimum of 1% ?

User avatar
Marvin Martian
Posts: 3547
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Wed, 17. Jan 18, 11:20

min Hull

Code: Select all

<set_object_min_hull object="$Ship" exact="1"/>
but this should reset at the end, otherwise this ship can't die in a fight

maybe something like

Code: Select all

<set_object_relation_behaviour object="$bordingTarget" disable="true"/>
<do_all exact="$enemyFactions.count" counter="$x" > 
  <set_relation_boost object="$bordingTarget" faction="$enemyFactions.{$x}" value="0.1"/>
</do_all>
could help to stop shooting too, but this is untested

and also here <set_object_relation_behaviour> and <....relation_boost> should reset to default afterwards

oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

Post by oliverjanda » Wed, 17. Jan 18, 13:57

reseting is no issue. I have to do it for faction change as well, in case the boarding fails.
Making the ship invincible is nice because its very simple. On the other hand its unimmersive...

I experimented already a lot with relation boosts and had no success with my own ships as boarding sets the relation to -1. but i will give your way a try later today.

oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

Post by oliverjanda » Wed, 17. Jan 18, 20:16

I tried this without effect:

Code: Select all

				<cue name="ProtectBoardee" instantiate="true" version="100">
					<conditions>
						<event_object_attacked object="$target"/>
					</conditions>
					<actions>
										
						<do_if value="$flag == true and event.param != player.primaryship and event.param != @player.ship">
							<cease_fire object="event.param"/>	

							<do_if value="event.param.defencenpc"><!--capships-->
								<signal_objects object="event.param.defencenpc" param="'stop attack'"/>
							</do_if>
							<do_else><!-- fighters-->
								<set_relation_boost object="$target" otherobject="event.param" value="0.5"/> 
							</do_else>
						

							<debug_text text="event.param + ' ceasing fire'"/>
						</do_if>
					</actions>
				</cue>
And changing faction relation might have quite a global effect for a short time.

User avatar
eMYNOCK
Moderator (DevNet)
Moderator (DevNet)
Posts: 2060
Joined: Thu, 21. Aug 03, 10:37
x4

Post by eMYNOCK » Mon, 22. Jan 18, 17:09

cant help much...

maybe the source code of that workshop mod has any hints?

http://steamcommunity.com/sharedfiles/f ... =636772477

works pretty well for me... authorities cease fire on Pirate Vessels during a Boarding... only thing i have to do is to send my fleet out of the combat area.

Post Reply

Return to “X Rebirth - Scripts and Modding”