[Script] AStar Pathfinder v1.3 (Mar 3)

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

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

User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 » Wed, 14. Mar 07, 09:56

Can someone re-upload this elsewhere? Aparently Aalaar's strike9 account is empty ...and I love this script :D
*** modified ***

[ external image ]

BlackRazor
Posts: 4708
Joined: Tue, 20. Apr 04, 17:39
x4

Post by BlackRazor » Wed, 14. Mar 07, 11:29

halo112358 wrote:Can someone re-upload this elsewhere? Aparently Aalaar's strike9 account is empty ...and I love this script :D
I have reuploaded the spk version on rapidshare.
"For the love of the Fish-Queen!"

User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 » Wed, 14. Mar 07, 20:16

BlackRazor wrote:
halo112358 wrote:Can someone re-upload this elsewhere? Aparently Aalaar's strike9 account is empty ...and I love this script :D
I have reuploaded the spk version on rapidshare.
Thanks much.
*** modified ***

[ external image ]

User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 » Fri, 6. Apr 07, 04:25

I hacked AStar to use a jumpdrive, if anyone else is interested I put it online over at Xai Corp: http://xai-corp.net/en/node/1382/

If you use it and like it let me know ;-) If you find a bug, send me a pm or open a ticket. Once it's tested by a few people I'll make a thread for it and stop polluting Aalaar's :D
*** modified ***

[ external image ]

Humble Merchant
Posts: 21
Joined: Sat, 4. Aug 07, 03:53
x3

Post by Humble Merchant » Sat, 15. Sep 07, 21:24

To HALO or anyone else with the knowledge about this astar script function/system.

I was wondering if it is possible to make a similar replacement script like the jump enabled move.movetosector for the the move.movetosector script.

The reason is that the AI mostly uses the move.movetostation script and not the move.movetosector and then the AStar pathing is not used for the AI and it suicides into xenon sectors.

I was thinking if a replacement script for move.movetostation (similar to how the move.movetosector script works) could be made to force the AI that uses this script to also use the AStar pathfinding.

I have looked in the scripts but this is way over my head, any ideas would be good if any one knows!

Thanks.

draffutt
Posts: 4292
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt » Sat, 15. Sep 07, 21:59

if you change the

Code: Select all

$PlayerOnly = [TRUE]
to

Code: Select all

$PlayerOnly = [False]
the AI should be using the AStar system.

also:
From the Readme if you want the AI to use AStar at every possible opportunity install the optional!move.movetosector replacement. The setup file in this optional package will switch on AI use of AStar as well.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes

Humble Merchant
Posts: 21
Joined: Sat, 4. Aug 07, 03:53
x3

Post by Humble Merchant » Sat, 15. Sep 07, 22:30

No only the AI ships specifically calling the COMMAND_DOCKAT command will use the script movetostation from the AStar if set to FALSE. The rest will not and instead use the original movetostation script instead (which are the majority of the AI ships).

This since they dont seem to call the COMMAND_DOCKAT but instead the script move.movetostation directly avoidingthe use of the command COMMAND_DOCKAT.

Also the customcosts will not be used for the AI since it is set to player only in the script ADB.AStar.RequestPath and thus the AI will never use your custom costs (ADB.AStar.GetPlayerCustomCosts) for avoiding enemy sectors. This is true for both the COMMAND_DOCKAT calls and the COMMAND_MOVE_SECTOR call.

Code: Select all

ADB.AStar.RequestPath

013     if $defaultRace == Player
014 @    $customCosts = [THIS] ->
callscript 'ADB.AStar.GetPlayerCustomCosts' : 
015     else
016 @    $customCosts = [THIS] -> call script 'ADB.AStar.GetRaceDefaultCosts' :  Race=$defaultRace
017     end
My idea would be the following if which works but I dont know how stable it is. The races for those to use AStar would be inserted.

Code: Select all

ADB.AStar.RequestPath

013     if $defaultRace == Player
014 @    $customCosts = [THIS] -> call script 'ADB.AStar.GetPlayerCustomCosts' : 
013     else if $defaultRace == Argon
014 @    $customCosts = [THIS] -> call script 'ADB.AStar.GetPlayerCustomCosts' :
015     else if $defaultRace == Boron
016 @    $customCosts = [THIS] -> call script 'ADB.AStar.GetPlayerCustomCosts' :  
017     else
018 @    $customCosts = [THIS] -> call script 'ADB.AStar.GetRaceDefaultCosts' :  Race=$defaultRace
019     end

draffutt
Posts: 4292
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt » Sat, 15. Sep 07, 23:31

Humble Merchant wrote:I was wondering if it is possible to make a similar replacement script like the jump enabled move.movetosector for the the move.movetosector script.
i am guessing the second one was suppose to be move.movetostation rather then move.movetosector.

but now that we are on the same page and i see what it is you are after. it would just require adding one line if the command existed. one of the more knowledge scripters here are going to have to say if it is possible or not. because when i open up the movetostation it is using the dockat command to do so. the only difference is the spelling (its defined as [DOCKEAT] but in the command listing you choose from its listed as dockat) also if the station isn't in the sector it is trying to reach then it calls move_sector which is already defined in the setup of AStar (so it should be working). you shouldn't need to add all those lines unless you wanted to restrict AStar to a specific race.

but as i said one of the more knowledgable ones will have to clarify.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes

-EposOne-
Posts: 72
Joined: Sun, 28. Sep 08, 10:30
x4

Post by -EposOne- » Fri, 3. Oct 08, 15:29

i DL and installed the Plugin Manager and installed the script, my question after the script is enable does the Sector pathfinder scipt start automatically then or do i need to switch on something else in the game? second and last, do i need to activate the vanilla profile too?

cheers guys

Post Reply

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