[Discussion] Generic X3TC S&M questions II

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren »

I have a permissions question regarding questions and answers given in this forum.

I have no idea as to if this will involve legal matters or not and i'm hoping someone can give some answers or a moderator can find out.

The reason i ask is that as some of you know i have been slowly working on updating some of the info in regards to the M.S.C.I. This may not lead to a public release, but you never know, so i better find out now if i can.

As an example, i would like to use s9ilent's question in regards to tasks running scripts and the object running the task being destroyed and cycrow's answer.

Do i need to get permission off both s9ilent and cycrow ?
or
Is inserting the persons name that is being quoted enough?

My example would be,
s9ilent wrote;
Q:
I know that when a ship is running a script, and the ship dies, that the script stops, but, what happens if say
-shipmain is running a task, which then does a
-$ship1 -> call script xyz
-The ship1 script is half way through executing when ship1 dies

Does the script return null? or continue to run?

Cycrow wrote;
when a ship dies, all scripts on that stack are stopped, regardless of where they are.

so both the task and the called script will be stopped the moment the ship dies
If someone knowledgeable in these matters could give an answer i would be gratefull, or if they could find out the rules regarding this.

Thank you
MarCon
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

:O so the $shipmain task is completely killed :O
Hrmmm.... I'll have to re-write my script then


@mark
I don't mind, and I'm sure no one else will mind either
Buttt if your that worried, I'm sure you can just change the example and it will be an original work.
mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren »

@s9ilent

Thanks for the permission.

I'm hoping most people would not mind, but, you never know, there will possably be those who do. I would rather get it right from the start than cause any problems later on. So i'll see if a moderator can give me an answer and failing that i may have to do as you suggested and just rewrite it in a different format.

Thanks for your responce.

As your original question demonstrated, the way 2 statements interact in the SE can be a bit of a surprise in regards to their individual use when the environment that they are used in changes and their reaction to it. I thought this was a useful piece of info to know.

MarCon
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

Quoting people isn't an issue
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses
mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren »

LV wrote:Quoting people isn't an issue
Thanks LV, just checking.

MarCon
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

People would have to be pretty mean to try and get you done for quoting a question...
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

I've got another problem with the Killed signal. The script it calls seems to be rather more connected to the death than I would like... as in, if I set it to call a script with a wait command that amount of time passes before the ship actually sort of dies... :lol:

So I just get a useless shape with 0% hull waiting.

Now, that's ok for my capital damage (useful infact). I'm getting it to wait for ~5 seconds before actually blowing up,a nd the autopilot to warn you, so you can make a quick escape... sort of a 'She's gonna blow!' moment.

But something else I'm doing requires a wait fo 1 hour... which doesn't work too well... :wink:

Is it a problem with priority or what?
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Signals should NEVER EVER EVER EVER (at least the MSCI and Cycrow says not to) have waits in them. They should always be instantly start and instantly finish. (Other wise you have 5 seconds of invincible - thou if that is a desired effect they by all means)



So if you need to have a delay in a signal started script, fork it off to a new global task, with all the arguments it needs (Remembering that the ship is dead, so you won't be able to reference it any more)

$nul = null
START $nul-> your script :your script args
(Note, I'm not to sure why, but you can't use start task on the above $nul trick, you can only use a normal script call with the START prefix)

e.g. Your script would probably want
$position array {x,y,z,sec}
$shiptype?/damage (probably damage)
other information
And then send that to a global task
EFSEAR
Posts: 25
Joined: Fri, 12. Feb 10, 21:30
x3tc

Post by EFSEAR »

Hi. Rather than starting anew thread I thought I'd ask here. How to create a fake patch? I want to use Deadlyda's mod and No Civilians which of course is either one or the other. Thanks in advance :)
Yes? Want something you?
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12187
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

You don't actually create fake patches. Fake Patch is usually called when you put the cat files in the main directory rather than putting them in the mods folder "fake patching it". This is actually patching, I guess users started to call it "fake" due to its not signed nature, as in not from Egosoft.

To make mods compatible, you need to make sure none of the files get overridden. Therefore you need to check which files are common to both mods. Should they not have common files you can put one in the mods folder and the other one as "fake patch" by renaming the cat AND the dat files to the next higher number.

Should they have common files its tricky as you have to merge the files. This means that you have to port the changes from one file to the other. Otherwise one will get overridden and may have bad consequences.

Sometimes one just can't merge mods as the changes are in conflict, as in they are mutual exclusive, making it impossible to merge. Not much one can do in those cases, other than not use one of the mods.

MFG

Ketraar
Image
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

I'm pretty sure I saw an option in the SE for 'get price of ship at shipyard' or similar, can anyone point me in the right direction? Can't find it for the life of me! If not, is there an alternative? Note, it has to work on any ship, whether you can buy it or not. It just has to fetch the inbuilt price of the ship.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Ok, I've completed an absolute BEAST of a script which needed me to input loads of manual multipliers. The only thing missing is the question above. Anyone know a way around this?

Anyway, that's not the point, the point is I want to know now how crazy this script is, if it'll work, and if (where :wink: ) I've made loads of stupid mistakes.

Would anyone object to me posting a large amount of code here, or should I start a new thread?
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12187
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

I suggest to host the file rather than puting code. But thats just me.

MFG

Ketraar
Image
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Nowhere to host it ATM.

Please, where do I get the price of a ship from, I've looked everywhere! :roll:

Anyway, the script appears to sort of work other than that, but I'm not quite sure, they'll be hundreds of problems and I confused myself out of my mind making it...
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
TwilightWalker
Posts: 35
Joined: Sun, 23. Sep 07, 09:35
x4

Post by TwilightWalker »

EmperorJon wrote:I'm pretty sure I saw an option in the SE for 'get price of ship at shipyard' or similar, can anyone point me in the right direction? Can't find it for the life of me! If not, is there an alternative? Note, it has to work on any ship, whether you can buy it or not. It just has to fetch the inbuilt price of the ship.
Would this help?

Ship price calculations.

It seems as if you need to get the RelVal and then do...Math.
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

3 problems:

1. RelVal is for wares, how will I get it for a ship?

2. How to I times by

80.7212

when I'm not allowed to put points... :wink:

3. How do I check to see if it's
(one-off exceptions are SS_SH_A_M1: factor = 49.892, SS_SH_A_M2 & SS_SH_T_M2: factor = 50.299)
one of those 3 ships. What ships are they anyway?

EDIT: Problem one solved. Used it on a ship and got within 100,000 without going to decimal. As for decimal, I guess I'll just have to say 807212/10000 and see how close it rounds correctly...

So.

1 & 2 solved. Onto 3.
(one-off exceptions are SS_SH_A_M1: factor = 49.892, SS_SH_A_M2 & SS_SH_T_M2: factor = 50.299)
SS_SH_A_M1 & SS_SH_A_M2 are I believe just the Colossus and Titan.

In which case, SS_SH_T_M2 is just the Phoenix...

Confimation?
Last edited by EmperorJon on Tue, 6. Apr 10, 21:39, edited 1 time in total.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

EmperorJon wrote:Nowhere to host it ATM.
Even if your ISP doesn't offer free hosting, there are tons of websites that do - filefront, fileshack, mediafire, depositfiles, etc...
RelVal is for wares, how will I get it for a ship
Ships also have a ware type.
80.7212
(x * 807212)/10000 (but watch for overflow problems).
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Anyway. Thanks for proving me right, 3rd question above...

EDIT: Oh, and just noticed, it says M6M.

What's that? I've tried it with M6s and M8s and not got it right...
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

@ EmperorJon
Instead of using rel values, I'm fairly sure (not 100%) you can just use
$ware = $ship->get ware type code of object
$price = get average price of $Ware
(They iterate through all onboard wares if you want)

And (IMHO) if your going to post phenominal mounts of many scripts, you should probably put it in a different thread, otherwise, if it's just one script fire away either will do.
User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

iirc, the average price of a ship ware is different to the actual price of the ship, for some reason (although it's a while since I checked).

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”