[Discussion] Generic X3TC S&M questions II
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
All missile models include huge collision boxes.
I suppose that was necessary with the painfully inept vanilla missile defense scripts... once upon a time.
I suppose that was necessary with the painfully inept vanilla missile defense scripts... once upon a time.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 122
- Joined: Tue, 26. Sep 06, 01:15
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
It will not default. It will have no language file.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 122
- Joined: Tue, 26. Sep 06, 01:15
-
- Posts: 1
- Joined: Sun, 16. Jan 11, 03:07
-
- Posts: 378
- Joined: Thu, 12. Oct 06, 10:49
I have a mod in mind, which I think is fairly simple... But I'm not entirely sure it's possible.
I'd run an AL on all player ships in the galaxy, when one of these gets attacked, the player is warned.
However, with a twist... The player can press certain hotkeys to do actions.
EG:
- F9 to view the sectormap of where the attack is
- F10 to jump to said sector (to the gate the closest to the attacker, if it's possible to get a travel direction, perhaps I'd calculate which gate is better with the ship's speed in mind).
- F11 to let the attacked ship try to make an emergency jump to the nearest friendly sector with a friendly base. (or a nearby sector/station if there's not enough energy)
etc
I'm sure the last two can be done with scripts one way or the other. But I'm not sure if scripts can show the sector map. At least when not asking for user input.
Is there someone who could reassure me that it is possible? (And perhaps give me a pointer of what I'd have to do.)
Thanks!
I'd run an AL on all player ships in the galaxy, when one of these gets attacked, the player is warned.
However, with a twist... The player can press certain hotkeys to do actions.
EG:
- F9 to view the sectormap of where the attack is
- F10 to jump to said sector (to the gate the closest to the attacker, if it's possible to get a travel direction, perhaps I'd calculate which gate is better with the ship's speed in mind).
- F11 to let the attacked ship try to make an emergency jump to the nearest friendly sector with a friendly base. (or a nearby sector/station if there's not enough energy)
etc
I'm sure the last two can be done with scripts one way or the other. But I'm not sure if scripts can show the sector map. At least when not asking for user input.
Is there someone who could reassure me that it is possible? (And perhaps give me a pointer of what I'd have to do.)
Thanks!
-
- Posts: 1962
- Joined: Tue, 8. Jan 08, 18:19
For that, signals are the mechanism of choice since they are only emmited when needed and thus do not create performance overhead.I'd run an AL on all player ships in the galaxy, when one of these gets attacked, the player is warned.
You can show the appropriate sector map by using the "get user input: type= sector=$attackSector" command. However, the map that shows up does not have the same functionality as the normal sector map (i.e. you cannot access a ships console, etc.). Unfortunately there is no way to open the "real" sector map via SE.But I'm not sure if scripts can show the sector map. At least when not asking for user input.
As you noted yourself, the last two can be done with scripts quite easily.
Greetings,
ScRaT
-
- Posts: 378
- Joined: Thu, 12. Oct 06, 10:49
Thank you for your reply.
And without seeing where I'm getting myself in to, there's no point in just jumping in the sector. :-/
Bugger! I was afraid of that. :-/ Is it at least a map where you can see the name of the ship? I'm not terribly good at linking icons to actual ship sizes... Specially when there are multiple ships in the same spot. :-/ScRaT_GER wrote: You can show the appropriate sector map by using the "get user input: type= sector=$attackSector" command. However, the map that shows up does not have the same functionality as the normal sector map (i.e. you cannot access a ships console, etc.). Unfortunately there is no way to open the "real" sector map via SE.
And without seeing where I'm getting myself in to, there's no point in just jumping in the sector. :-/
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Try something like this:
$message = sprintf: pageid=$pageid textid=$textid, $var1, $var2, null, null, null
send incoming question $message to player: callback='ScriptName' (more info on questions)
$null = null
$ship = $null -> get user input type={DATATYP_SHIP}, title=Choose Ship, sector=$attackedsector
Open your menus and have it
START $ship -> command <Object Command>: arg1=<Value>, arg2=<Value>, arg3=<Value>, arg4=<Value>
You will be able to select the ship with the attacked sectormap then have it call a menu which you can then have do whatever command you want.
$message = sprintf: pageid=$pageid textid=$textid, $var1, $var2, null, null, null
send incoming question $message to player: callback='ScriptName' (more info on questions)
$null = null
$ship = $null -> get user input type={DATATYP_SHIP}, title=Choose Ship, sector=$attackedsector
Open your menus and have it
START $ship -> command <Object Command>: arg1=<Value>, arg2=<Value>, arg3=<Value>, arg4=<Value>
You will be able to select the ship with the attacked sectormap then have it call a menu which you can then have do whatever command you want.
-
- Posts: 677
- Joined: Tue, 8. Dec 09, 17:50
I have a mod in mind, and there are some things I would like just clarified as my understanding of modding is very limited.
1) I'm fairly sure I've seen something with regards to a universe editor, so with this in mind I'm simply wanting confirmation. Is it possible to add your own sectors in a pre-determined location by the modder?
2) Audio wise, are you able to add your own audio files for things such as ship names, sector names, and NPC comms?
3) I have in mind to create a sort of plot along with a mod, so are you able to create your own plot-style missions or are you limited to just the pre-existing types of missions (ie. "Deliver X amount of Goods", "Protect Station", "Patrol to Sector X", etc)
4) Another one for confirmation, but can you add additional gates and link said gates? Also making it possible for the new gates to be reconised by the HUB?
5) Are new ship models restricted in any way? Such as turret counts (I'm fairly sure they are - how many turrets are ships limited to?), poly counts, etc?
6) Can you add and use your own textures?
7) Can you add your own weapons with their own custom effects/images?
(I'm fairly sure I had more questions, but I can't remember them now.)
1) I'm fairly sure I've seen something with regards to a universe editor, so with this in mind I'm simply wanting confirmation. Is it possible to add your own sectors in a pre-determined location by the modder?
2) Audio wise, are you able to add your own audio files for things such as ship names, sector names, and NPC comms?
3) I have in mind to create a sort of plot along with a mod, so are you able to create your own plot-style missions or are you limited to just the pre-existing types of missions (ie. "Deliver X amount of Goods", "Protect Station", "Patrol to Sector X", etc)
4) Another one for confirmation, but can you add additional gates and link said gates? Also making it possible for the new gates to be reconised by the HUB?
5) Are new ship models restricted in any way? Such as turret counts (I'm fairly sure they are - how many turrets are ships limited to?), poly counts, etc?
6) Can you add and use your own textures?
7) Can you add your own weapons with their own custom effects/images?
(I'm fairly sure I had more questions, but I can't remember them now.)
-
- Posts: 378
- Joined: Thu, 12. Oct 06, 10:49
Wauw, thanks! *saves the snippet*h2o.AvA wrote:Try something like this:
$message = sprintf: pageid=$pageid textid=$textid, $var1, $var2, null, null, null
send incoming question $message to player: callback='ScriptName' (more info on questions)
$null = null
$ship = $null -> get user input type={DATATYP_SHIP}, title=Choose Ship, sector=$attackedsector
Open your menus and have it
START $ship -> command <Object Command>: arg1=<Value>, arg2=<Value>, arg3=<Value>, arg4=<Value>
You will be able to select the ship with the attacked sectormap then have it call a menu which you can then have do whatever command you want.
-
- Posts: 378
- Joined: Thu, 12. Oct 06, 10:49
Yes.Omini wrote: 1) I'm fairly sure I've seen something with regards to a universe editor, so with this in mind I'm simply wanting confirmation. Is it possible to add your own sectors in a pre-determined location by the modder?
Yes.Omini wrote: 2) Audio wise, are you able to add your own audio files for things such as ship names, sector names, and NPC comms?
Yes.Omini wrote: 3) I have in mind to create a sort of plot along with a mod, so are you able to create your own plot-style missions or are you limited to just the pre-existing types of missions (ie. "Deliver X amount of Goods", "Protect Station", "Patrol to Sector X", etc)
No.
Yes.Omini wrote: 4) Another one for confirmation, but can you add additional gates and link said gates? Also making it possible for the new gates to be reconised by the HUB?
There are restrictions, but I don't know them. Turrets are defenitly limited. I _think_ 6 turrets and 48 guns. But I'm not sure.Omini wrote: 5) Are new ship models restricted in any way? Such as turret counts (I'm fairly sure they are - how many turrets are ships limited to?), poly counts, etc?
Yes.Omini wrote: 6) Can you add and use your own textures?
Yes.Omini wrote: 7) Can you add your own weapons with their own custom effects/images?
There are mods which have done this. Have a look at XTC (Xtended: Terran Conflict).
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
What are some different ways for a ship to continuously check for a condition, run some code when the condition is met, then continue checking for it?
This lovely bit of code:
Any others?
This lovely bit of code:
Code: Select all
while [this]->exists
while !$condition
= wait 1000 ms
$condition = [this]->get condition
end
gosub code
end
Last edited by h2o.Ava on Wed, 26. Jan 11, 09:34, edited 1 time in total.
-
- Posts: 2033
- Joined: Wed, 29. Jun 05, 01:45
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
Code: Select all
while [this]->exists
It is identical to "while [TRUE]", which you should use for ease of reading.
A simpler construction (fewer nested loops to keep track off for one) would be...
Code: Select all
while $Object ->get condition
= wait 1000 ms
skip if $Object->exists
break
gosub code
end
Their benefit is a handy on/off switch which is a neat thing to have in a global script.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
You can properly use the MD to check for conditions but that makes no real difference.
Every MD check has to be calculated the exact same way and if the SC has to check Condition A every 1000ms it's no better or worse than the MD checking Condition A every 1000ms.
It's no magic wand to check conditions "for free", only a different wording that looks more elegant in some cases.
Every MD check has to be calculated the exact same way and if the SC has to check Condition A every 1000ms it's no better or worse than the MD checking Condition A every 1000ms.
It's no magic wand to check conditions "for free", only a different wording that looks more elegant in some cases.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.