[SCRIPT] Race Military + Patrol Missions V1.10 : Updated 15/08/2006

The place to discuss scripting and game modifications for X³: Reunion.

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

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Mon, 6. Mar 06, 08:18

The other way would be to check the player ship and spawn a leader that's bound to be slower than it?

Or, do like Wing Commander and spawn navsats as waypoints (with timers, like LV's deathmatch countdown timer sats) and have them follow you instead.

Tritous
Posts: 899
Joined: Sat, 15. Jan 05, 17:20
x3tc

hmm

Post by Tritous » Mon, 6. Mar 06, 09:06

how about a twist... if you get more than 3 km away the fleet stops and waits for you. if you don't "quit fooling around" within a minute you fail. or if you go more than 5km away you fail.

that would sort out them being too fast etc. also, perhaps small reductions off the rewards at the end if you go too far more than 3 times.
Give a man a fire, he'll stay warm for a day
Set a man on fire, he'll stay warm for the rest of his life ;)

Darklight86
Posts: 210
Joined: Mon, 14. Nov 05, 19:46
x3

Post by Darklight86 » Mon, 6. Mar 06, 19:31

I can't seem to find the 'sign up' in the BBS, is it random or should it always be there?
>3.2 Ghz
>2gig RAM
>X850XTpe GPU
>865p NEO 2 fisR
>SB X-Fi

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 6. Mar 06, 20:08

its random, and quite rare, you will have to search for it ;)

EKS
Posts: 60
Joined: Wed, 25. Feb 04, 19:22
x3tc

Post by EKS » Sun, 19. Mar 06, 00:11

Playing around with this mod i discovered 2 things that could be improved:
1) The patrol can have a speed above your ships maxspeed
2) I had a xenon ship pilot eject, is that normal?

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Sun, 19. Mar 06, 00:23

the, the xenon are just created as normal xenon, the ejecting is handled by the game engine itself.

but u shoudl be able to cap them yes ;)

Armegeddon
Posts: 393
Joined: Fri, 26. Dec 03, 13:37
x4

Post by Armegeddon » Mon, 20. Mar 06, 00:57

Hate to say it, but there's still the bug where you fail the mission when the leader goes through a jumpgate. I have the leader on follow until he starts maneuvering to enter a jumpgate, then I manually follow him. I try to stay within 200 meters of him right until he goes through, then immediately follow. 3 times now he's gone through and in the 3 seconds it takes me to go through afterwards I get the 'incoming message' and when I come out the other side and read the message I find out I failed the mission because I got too far away.
There is a thin line between genius & insanity i have erased this line

Armegeddon's X3 scripts and mods

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 20. Mar 06, 01:44

tthe problem is, now the leader only starts moving once ur in the sector.

so in the time from when u enter the sector till u get control of ur ship, the leader has already moved out of range
and i really dont know how to stop this from happening, its really annoying

if u have any suggestions, then ill welcome them

5hakes
Posts: 17
Joined: Wed, 3. Aug 05, 22:48
x3

Post by 5hakes » Mon, 20. Mar 06, 04:00

Cycrow, I have an idea for another mission you could incorporate:

A blockade mission, where in a random one of your races border sectors, there is a military installation that is being blockaded by a fleet of another race. If you dont want to actually model an installation, you could just say its a wheat farm that supplies food to argon troops or something.

THe cargo could be units of mosquito/fireflys/ires/pacs that are directly given upon accepting the mission. (obv if the player sells them off he will be released from the mil.)

The fleet could be circling within say a 4 or 5 km radius of the station, and attack anything that tries to dock. (ie any player ships).

There would be 2 possible ways of completing it:

- destroy the fleet completely, which should be very hard and scaled based on the players combat rank (if possible)

-distract the fleet by attacking it and running causing it to give chase and have another ship bring the cargo in from the other side...

option 2 could then allow the player to assist in destroying the enemy fleet with the help of the newly equipped fleet waiting in the station for a bonus.

This is all mere theory of course, i dont know how well any of this would actually work in game with other ships interfering and what not. Just an idea... Maybe The fleet could only spawn when a player owned ship enters the sector.

Armegeddon
Posts: 393
Joined: Fri, 26. Dec 03, 13:37
x4

Post by Armegeddon » Mon, 20. Mar 06, 05:48

Cycrow wrote:tthe problem is, now the leader only starts moving once ur in the sector.

so in the time from when u enter the sector till u get control of ur ship, the leader has already moved out of range
and i really dont know how to stop this from happening, its really annoying

if u have any suggestions, then ill welcome them
I think you misunderstood what the problem I'm seeing is. I get the message Immediately after the leader goes through the gate, before I go through, but there isn't enough time for me to read it until after I go through the gate since I'm right on the leaders tail when he goes through.
A possible solution would be for the distance check to wait until after the escorts have gone through the gate, since they are on follow also, they will take several seconds to jump after the leader due to the autopilot constantly trying to avoid the gate while on follow until the leader gates.
This would also help with the problem of staying in follow mode while the leader jumps and then the autopilot sending the playership through the gate. With the changes to the autopilot in 1.4, if I stay on follow while the leader gates, I usually end up directly besides the gate at the point the leader goes through, so the autopilot takes abit to manuever back to position.
That paragraph made more sense when I was thinking it, but not after typing it.
There is a thin line between genius & insanity i have erased this line

Armegeddon's X3 scripts and mods

5hakes
Posts: 17
Joined: Wed, 3. Aug 05, 22:48
x3

Post by 5hakes » Mon, 20. Mar 06, 05:51

Just another thought on my last post,

You could have missions of varying difficulty like your other mods, so for example if you get a reasonably easy mission you could conceivably fly in avoiding enemy fire and dock with the station (without using autopilot docking in which case youd get shot down from slowing down too much).

This might work better and seem more realistic (and fun) with an enclosed station like the equipment dock.

Maybe we should look around for talented station modellers to do some enclosed style military stations...I know moxy is damn good at ship modelling...

If not then would it be possible to just use the race eq dock models but with military names?

avicenna
Posts: 398
Joined: Sun, 30. Nov 03, 12:32
x3tc

Post by avicenna » Mon, 20. Mar 06, 07:24

Cycrow wrote:
the problem is, now the leader only starts moving once ur in the sector.
I think there is something else going on as well. On a couple of occasions over the last couple of days I have got the mission failed too far away message prior to jumping. On both occasions I was within 150 m of the leader at the time he jumped.

I am using version 1.02.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 20. Mar 06, 16:22

hmm, interesting, as long as you within 5km when the leader goes through the gate it shouldn't fail.

when i was testing once the leader went through the gate, i could stay in the system for a long time without failing

ill look into it, c if i can find out how to fix it

Ile
Posts: 9
Joined: Mon, 6. Feb 06, 14:52
x3

Post by Ile » Mon, 20. Mar 06, 18:05

I have same problem as Armegeddon -> I fly trough several sectors following the flight leader and occasionally fight of some xenons... and then the patrol wing just stops in the middle of the sector and sits there forever, doing nothing. You said you are going to check whats the problem, but I just thought that I should report that Armegeddon is not the only one with this malfunction... I have none of the other problems discussed in this topic, but this one happens to me very often (approx. 1/2 of all military missions).

Strange and frustrating... :(

User avatar
Trevelvis
Posts: 1042
Joined: Sun, 4. Apr 04, 15:20
xr

Post by Trevelvis » Mon, 20. Mar 06, 19:15

I also have the problem of when the leader flies through a gate even though I am on follow him, I fail. also I have noticed sometimes when you are fighting the last enemy , if your fight has taken you a bit away from the leader ,you fail also , is there not a way to increase the range as its very annoying failing more times than not ???

This has the potential to be one of the best scripts out there but at the moment it just isnt workable. for instance I was just doing a patrol mission and I was 265 m away from the sector leader when he went through a gate and as I got the message no aim within a second I get the mission failed too far away, So I reload the game and this time he goes through and I fumble to get through the gate and I must take 15 secs to do so, but no mission failed so I latch on to the leader and within 20 secs we get attacked so I kill the enemies that are attacking us and as I kill the last one I get the too far away mission failed again but I was within 3km to the leader. I hope this can get sorted as I will stay clear of it for now as too frustrating failing all the time but look forward to many more hours of fun with it in the future !!!

acolorado
Posts: 6
Joined: Tue, 18. Jan 05, 01:23
x3

nice script

Post by acolorado » Tue, 21. Mar 06, 04:27

First off awesome scripts Cy. The race military is terrific but I also have trouble with the mission failing in a seemingly random fashion at times. I've had some missions which are successful and others where even though I'm only a few Km from the Leader (even following the leader) I get the fail message. Perhaps you could up the distance quite a bit or change to a "keep up" message as has been suggested. Looking forward to those new missions too. Thanks!

User avatar
Mobuj
Posts: 293
Joined: Wed, 23. Nov 05, 00:30
x3tc

Post by Mobuj » Tue, 21. Mar 06, 08:55

Cycrow

This problem feels like an inherent X3 bug. The plot line scripts likely have hard coded X3 code to overcome the scripting limitations and problems.

Edit for typo
---------------------------
I am Popeye of Borg
You will be askimilated!

Armegeddon
Posts: 393
Joined: Fri, 26. Dec 03, 13:37
x4

Post by Armegeddon » Tue, 21. Mar 06, 13:00

I think I may have solved the "failed mission going through gate" problem.
Here is my modified section of plugin.military.patrol.check

Code: Select all

134   * check distance between leader and player ship
135     $Dist = get distance between [PLAYERSHIP] and $Leader
136     $sectorcheck = $Leader -> is in same sector as [PLAYERSHIP]
137     $Leadspeed = $Leader -> get current speed
138     $LeadMax = $Leader -> get max speed
139     if $Dist > $MinDist AND $sectorcheck == [TRUE] AND $Leadspeed < $LeadMax
140      $Message = sprintf: pageid=$Page.ID textid=514, $Pilot, null, null, null, null
141      set quest state with message: quest=$Quest state=[Quest.Finished] msg=$Message
142      return null
143     end
I'm not sure if the sector check is really necessary as I put that in prior to the speed check.
The speed check is due to the fact that when the leader passes through the "event horizon" of the gate he appears to accelerate to very high speeds, although the indicator shows 0 speed. I tested this with several patrol missions, and didn't have a single fail when he was going through the gate.

I still occasionally get the problem where the leader stops just before the center of a sector and sits there forever. I don't think it's due to not detecting the end of mission, because I've had it happen in the very next sector after starting the patrol. I think it might be due to the precision of COMMAND_MOVE_TO might be greater than 1000 meters, but that is as close as you check. COMMAND_MOVE_TO may move the leader to 1002, 1002, 1002 and think it is complete, but the script doesn't agree, so it keeps telling the leader to move, but leader thinks he's close enough.
There is a thin line between genius & insanity i have erased this line

Armegeddon's X3 scripts and mods

Armegeddon
Posts: 393
Joined: Fri, 26. Dec 03, 13:37
x4

Post by Armegeddon » Wed, 22. Mar 06, 13:41

Update to my last post. Apparently I was a little over zealous in my assumption that adding the sector check and speed check in that way would solve the fail during gating problem. Am trying a version with instead of checking against max speed, I check if the leader is at zero speed. So far it seems to be working. Also placed each expression in the "if ..." line to be inside parentheses in case it makes a difference.
Also confirmed that the problem with the leader stopping near the center of the sector and doing nothing. I manually caused him to move closer to the center using a script and he continued on within a couple seconds of executing that script, so increasing the range of the distance to center check should correct that problem.
There is a thin line between genius & insanity i have erased this line

Armegeddon's X3 scripts and mods

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 22. Mar 06, 13:50

i dont think checking the speed is the correct way.
but i think i might have an idea that might work
im gonna make it so the leader doesn't start moving until the player ship gets close, rather than when he comes through the gate, this will insure that the player has actaully moved away from the gate.

as for the problem when it stops, 1km precision is that not acurate, and theres no reason y it cant make it to those coordinates within 1km, can you check what command is running on the ship when it stops

Post Reply

Return to “X³: Reunion - Scripts and Modding”