How to mod the !fight.attack.object file..answer inside

The place to discuss scripting and game modifications for X²: The Threat.

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

User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

How to mod the !fight.attack.object file..answer inside

Post by Kailric »

Has or does anyone know how to or even if its possible in 1.3 to example: replace the orginal !fight.attack.object.pck with a new one that was made with the in game editor and then renamed !fight.attack.object with a text editor in both the file name and code array and then compressed, crypted and then put in the game? Cause I can't seem to get it to work. And if you speak german ask over at the german forums for me would you please..they may no more than us sence thats where Egosoft is based...huh?




original post:
How would you change the !fight.attack.object file to one that is moded. Would you pack the new one as a pck file and just replace the original...don't seem like that would work though. Or how else would it be possible to change it. Trying to figure out just how to get the new combat AI in the game that I have been working on?
Last edited by Kailric on Thu, 8. Apr 04, 01:40, edited 4 times in total.
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
AalaarDB
Posts: 2282
Joined: Thu, 29. Jan 04, 08:19
x3tc

Post by AalaarDB »

That's the way you would do it, but make sure that you include every feature of the original, so you won't crash it or have ships behaving oddly.
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

Well would you have to start a new game..cause it seems you would be able to replace a file like that and then load a saved game and play with new scripts without haveing the "modified" logo appear. I have done this but when I load a saved game it asks all weird. Like hitting "." does not bring up the secotor map and things like that, but everything goes back to normal when I put the orginal back. Hmmm...maybe there is something in the code that I over looked that would cause an error. It works fine in the Demo I have.
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

Well I made an exactly copy of the orginal fight.attack.object by hand using the scripter, compressed it, and crypted it and put it in the game. But nothing will fight. It acks there is no file at all. All the Egosoft files have ! out in front of them and you can't put that with the script editor. Has anyone moded the orginal !"Egosoft".pck files yet and got them to work in the game?
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
Vanoblis
Posts: 61
Joined: Wed, 25. Feb 04, 03:28
x2

Post by Vanoblis »

Have you tried to put the ! in front of your modified script manually?
1 rename the file itself.
2 open the file with an normal texteditor (e.g. notepad) or any xml editor and change the name tag in the 4th line. In the code array at the bottom of this file is the correspondig sval tag which has to be change too. (secong tag)
3 start x2

think i've done this so once in v1.2 .. but not testet it with 1.3

greetz
Van

This sentence is not provable - Gödel
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

I wonder if script signing is getting in the way
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

Vanoblis wrote:Have you tried to put the ! in front of your modified script manually?
1 rename the file itself.
2 open the file with an normal texteditor (e.g. notepad) or any xml editor and change the name tag in the 4th line. In the code array at the bottom of this file is the correspondig sval tag which has to be change too. (secong tag)
3 start x2

think i've done this so once in v1.2 .. but not testet it with 1.3

greetz
Yeah, just did this. Still don't work, ships just come a complete stop. Hmm, maybe it does have something to do with being signed. How else could the script be put into the game. Has anyone made a mode of an orginal script and tried to replace it?
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

I think someone did it for the getware script but that was pre 1.3

I don't know if it works in 1.3

You could change the scripts attached to the relevent commands, that might work, but you'd have to rewrite the command scripts as well as the attack object script.
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

moggy2 wrote:I think someone did it for the getware script but that was pre 1.3

I don't know if it works in 1.3

You could change the scripts attached to the relevent commands, that might work, but you'd have to rewrite the command scripts as well as the attack object script.
Yeah, but what are the chances of getting that to work...if you can't replace a signed script. Thats prolly what the deal is. Unless I am doing something wrong...I will up load the file and let others tinker with it, see if anyone else can get it to work...juse a sec
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

Here is the script fresh out the in game scritp editor.......

http://webpages.charter.net/kailric/A.f ... object.xml


And here is the one I fixed with the xlm editor....

http://webpages.charter.net/kailric/!fi ... object.xml


you have to save target as....
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

Here is my idea. Here is the !init.ship.globalscriptmap.std script. I figure I can create a init script with just line 29..which should replace the original one?

Code: Select all

028   
029   global ship map: set: key=COMMAND_ATTACK, class=Ship, race=$race, script='!ship.cmd.attack.std', prio=0
030   
031   global ship map: set: key=COMMAND_ATTACK_RETURN, class=Ship, race=$race, script='!ship.cmd.attackreturn.std', prio=0
032   
And then make my own ship.cmd.attack.std script like the original below, but points to my new attack.object script. I have check and it seems all attack scripts except turrents lead back to that main attack script. So hopefully this way will work. I will have to check this tomorrow after work.

Code: Select all

001   [THIS] -> set command: COMMAND_ATTACK  target=$victim target2=$followsec par1=null par2=null
002   skip if [THIS] != $victim
003    return null
004   $followsec = ! $nofollowsec
005 @ = [THIS] -> call script '!fight.attack.object' :  the victim=$victim  follow in new sector=$followsec
006   return null

But it seems logical..aye?

Or would I have to redue the whole !init.ship.globalscriptmap.std and would it even replace the one thats already there?
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

Check on yahoo groups
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

i added somemore thoughts to the frist post
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
blackspell
Posts: 128
Joined: Sat, 6. Mar 04, 20:18
x2

Post by blackspell »

not sure on this, but i think there is no need to replace the script itself. with ' global ship map: add key' you should be able to override the command selection for combat (=set it to your script) since your setup/init script is called after the original ones.
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

blackspell wrote:not sure on this, but i think there is no need to replace the script itself. with ' global ship map: add key' you should be able to override the command selection for combat (=set it to your script) since your setup/init script is called after the original ones.

Yes, done this. But only thing is there are several (i count 17 so far, but only 5 are long ones) scripts the refer back to the orginal fight.attack.object script so instead of using your script it uses that one. All the battles that take place have different circumstances leading up to them and those circumstances all have their own script that point to the script in question, in other words. So if there is no other way I will have to manually redo all those scripts as well?
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

I was told to edit the unpacked scripts with a "text" editor and remove the ! in front of the names in line 4 i think and at the start of the codearray...that works.
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle

Return to “X²: The Threat - Scripts and Modding”