[SCRIPT] Satalite Early Warning Network V1.20 : Updated 09/03/2007
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 1093
- Joined: Sun, 7. Dec 03, 05:32
-
- Posts: 1093
- Joined: Sun, 7. Dec 03, 05:32
-
- Posts: 99
- Joined: Thu, 6. Mar 08, 07:26
Okay, I am just not smart enough to figure out some of this scripting. I've tried reading the MSCI and then manually tried diff combos with the ingame MSCI.
I "can" get the plugin.sewn.running to ID Xenon Stations and Pirate Bases, but I can't figure out how to get it to use a diff warning message for each.
I copied the sendWarning code and then just relabeled the two sections and added two new text IDs to the 447545.xml.
But it will only send the first original warning. (....detected an enemy ships). I can make the first sendWarning use the new text Id by just changing the number but that's it. It won't skip that one and use the other two.
Basically I don't know enough to get multiple GoSub to execute separately when called within the same script. Probably my bad End, EndSub and Return Nulls but I'm not getting anywhere by tinkering.
Anyone kindly put me out of my misery?
Thanks
I "can" get the plugin.sewn.running to ID Xenon Stations and Pirate Bases, but I can't figure out how to get it to use a diff warning message for each.
I copied the sendWarning code and then just relabeled the two sections and added two new text IDs to the 447545.xml.
But it will only send the first original warning. (....detected an enemy ships). I can make the first sendWarning use the new text Id by just changing the number but that's it. It won't skip that one and use the other two.
Basically I don't know enough to get multiple GoSub to execute separately when called within the same script. Probably my bad End, EndSub and Return Nulls but I'm not getting anywhere by tinkering.
Anyone kindly put me out of my misery?
Thanks
there are 2 warnings, once is text to the logbook and the other is a voice.
you can change the voice by simply adding new entries into the text file.
if all your doing is changing the log entry, then u will still get the voice warning a bout the ships.
also, remember that stations dont move, so they will always be in range of the satalites, so u'll end up getting continous warnings about them
you can change the voice by simply adding new entries into the text file.
if all your doing is changing the log entry, then u will still get the voice warning a bout the ships.
also, remember that stations dont move, so they will always be in range of the satalites, so u'll end up getting continous warnings about them
Well I didn't want to bother you with reviewing my noobish attempt at code but I guess I'll have to to explain what I'm doing.
I'm getting SEWN to do two things,
1) Announce the respawn of the two Xenon Stations that XTM keeps running at all times.
2) Announce the respawn of a Pirate station after I kill/push-it to another sector.
To try to get there I simply copied the code block for ID a ship and changed it to ID a station.
I didn't know about the "station always visible" so I figured to just max the distance since the Xenon stations and Pirate bases are often way out from center. I left the plugin.sewn.validship call but I guess it may not be needed.
I changed the gosub for each to try to make it use a diff text file only.
I know the if in the warning code needs an end but I probably don't have an endsub and a return null in the right places to allow the two new warning to be accessed properly.
Unless you are going to tell me this would require some more detailed branching code, I assumed I could simply offer it more "choices" and it would adhere to the diff gosub calls.
By placing the sats in all the sectors there shouldn't be a Station/Base, I'll get an immediate signal as soon as they respawn and I can chase them around.
I'm getting SEWN to do two things,
1) Announce the respawn of the two Xenon Stations that XTM keeps running at all times.
2) Announce the respawn of a Pirate station after I kill/push-it to another sector.
To try to get there I simply copied the code block for ID a ship and changed it to ID a station.
Code: Select all
021 $stations = find station: sector=$sector class or type=Xenon Station race=Xenon flags=[Find.Multiple] refobj=[THIS] maxdist=1000 maxnum=5 refpos=null
022 @ skip if not [THIS] -> call script 'plugin.sewn.validship' : Ship Array=$ships
023 gosub sendWarningXenon
024
025 $stations = find station: sector=$sector class or type=Pirate Base race=Pirates flags=[Find.Multiple] refobj=[THIS] maxdist=1000 maxnum=5 refpos=null
026 @ skip if not [THIS] -> call script 'plugin.sewn.validship' : Ship Array=$ships
027 gosub SendWarningPirates
I changed the gosub for each to try to make it use a diff text file only.
Code: Select all
048 sendWarningXenon:
049 $time = playing time
050 if $time > $last.send
051 $sector = [THIS] -> get sector
052 write to player logbook: printf: pageid=7545 textid=29, $sector, null, null, null, null
053 $last.send = $time + 300
054 = speak text: page=13 id=1276 priority=100
055 @ $sound.num = [THIS] -> call script 'lib.cycrow.getsoundnum' : Sector=$sector
056 = speak text: page=7 id=$sound.num priority=99
057
058
061
062 SendWarningPirates:
063 $time = playing time
064 if $time > $last.send
065 $sector = [THIS] -> get sector
066 write to player logbook: printf: pageid=7545 textid=30, $sector, null, null, null, null
067 $last.send = $time + 300
068 = speak text: page=13 id=1276 priority=100
069 @ $sound.num = [THIS] -> call script 'lib.cycrow.getsoundnum' : Sector=$sector
070 = speak text: page=7 id=$sound.num priority=99
I know the if in the warning code needs an end but I probably don't have an endsub and a return null in the right places to allow the two new warning to be accessed properly.
Unless you are going to tell me this would require some more detailed branching code, I assumed I could simply offer it more "choices" and it would adhere to the diff gosub calls.
By placing the sats in all the sectors there shouldn't be a Station/Base, I'll get an immediate signal as soon as they respawn and I can chase them around.
@spoidz...I see...Well if that is what you are trying to do, in my opinion, you are tinkering with the wrong script...A much better one to do what you are wanting would be this:
http://forum.egosoft.com/viewtopic.php?t=147822
But, you know what opinions are like...
http://forum.egosoft.com/viewtopic.php?t=147822
But, you know what opinions are like...
X3..The most fun a man can have...With his clothes on.
theres your first problem right there.spoidz wrote:Code: Select all
021 $stations = find station: sector=$sector class or type=Xenon Station race=Xenon flags=[Find.Multiple] refobj=[THIS] maxdist=1000 maxnum=5 refpos=null 022 @ skip if not [THIS] -> call script 'plugin.sewn.validship' : Ship Array=$ships 023 gosub sendWarningXenon 024 025 $stations = find station: sector=$sector class or type=Pirate Base race=Pirates flags=[Find.Multiple] refobj=[THIS] maxdist=1000 maxnum=5 refpos=null 026 @ skip if not [THIS] -> call script 'plugin.sewn.validship' : Ship Array=$ships 027 gosub SendWarningPirates
your calling the check script for ships, and sending in the ship array, not the station array.
set the ship array to $station.
althou it might be best to clone the validship and edit it for stations, althou not much editing should be needed
Next, the max dist is wrong, its a low value for a start, also, the script uses the scanner range for the max dist.
the scanner range is longer than the 1000, as thats only 1km away, the station would have to be very close
only the gosubs, did you paste everything ? it jumps from line 58 to 61.
your missing the end in the block and your missing the endsub
the endsub is what returns it back. Without it, it will first do whats in sendWarningXenon then do whats in SendWarningPirates then continue to whats after that.
each sub block needs an endsub before the next one starts, in general
the scanner range is longer than the 1000, as thats only 1km away, the station would have to be very close
only the gosubs, did you paste everything ? it jumps from line 58 to 61.
your missing the end in the block and your missing the endsub
the endsub is what returns it back. Without it, it will first do whats in sendWarningXenon then do whats in SendWarningPirates then continue to whats after that.
each sub block needs an endsub before the next one starts, in general