Is it possible to check a variable set in another star system?
For example, destroying the primary enemy base in System A sets baseDestroyed="True". Can System B (or a timer/station in System B) check whether baseDestroyed is indeed set to "True" to determine which set of encounters to use? (ie. Gate before the base is destroyed and a single ship demands a toll. Gate afterwards and a whole fleet is waiting to annihilate you.)
If it is possible, could an example be provided?
Interstellar Variables
- catfighter
- Militia Commander
- Posts: 466
- Joined: Fri Nov 08, 2013 5:17 am
- Location: Laughing manically amidst the wreckage of the Iocrym fleet.
Behold my avatar, one of the few ships to be drawn out pixel by pixel in the dreaded... Microsoft Paint!
Day 31: "I have successfully completed my time reversal experiment! Muahahaha!!!"
Day 30: "I might have run into a little problem here."
Day 31: "I have successfully completed my time reversal experiment! Muahahaha!!!"
Day 30: "I might have run into a little problem here."
- AssumedPseudonym
- Fleet Officer
- Posts: 1190
- Joined: Thu Aug 29, 2013 5:18 am
- Location: On the other side of the screen.
I don’t actually have an example I can provide off the top of my head — I’m a little rusty on tLISP after having been playing around with a different language — but my suggestion would be to put the variable in the station’s sovereign. Set it to true when the station is destroyed and put a little something in the code to run in <OnGlobalPlayerEnteredSystem> to trigger when they get to the target system. Not destroyed, one ship; is destroyed, enumerate through all of the ships and sic ’em on the player.
Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)
My mods on Xelerus: Click here!
Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)
- pixelfck
- Militia Captain
- Posts: 571
- Joined: Tue Aug 11, 2009 8:47 pm
- Location: Travelling around in Europe
I'm almost sure it is, at this moment, not possible to read data, set on objects in another star system.
Only your current star system is available in memory, al other star systems are dehydrated (= stored on disk in read only memory). Yet, it is, for example, possible check if objects exist in other star systems.
You can take a look at the Function list: 1.5. All functions which accept the nodeID argument can access data from different star systems.
Hope this helps,
Pixelfck
Only your current star system is available in memory, al other star systems are dehydrated (= stored on disk in read only memory). Yet, it is, for example, possible check if objects exist in other star systems.
You can take a look at the Function list: 1.5. All functions which accept the nodeID argument can access data from different star systems.
Hope this helps,
Pixelfck
-
- Developer
- Posts: 2997
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
pixelfck is right. Also, you should check out the unvFindObj function which can return some limited information about objects in other systems. For example, you can use it to figure out where Korolov stations are.
- catfighter
- Militia Commander
- Posts: 466
- Joined: Fri Nov 08, 2013 5:17 am
- Location: Laughing manically amidst the wreckage of the Iocrym fleet.
Should I instead set a global variable operable throughout the entire universe? I'm hesitant to do so, however, because if enough were set I feel sure the game would get rather clunky and could possibly have lag.
Behold my avatar, one of the few ships to be drawn out pixel by pixel in the dreaded... Microsoft Paint!
Day 31: "I have successfully completed my time reversal experiment! Muahahaha!!!"
Day 30: "I might have run into a little problem here."
Day 31: "I have successfully completed my time reversal experiment! Muahahaha!!!"
Day 30: "I might have run into a little problem here."
-
- Developer
- Posts: 2997
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
The recommended way is to use the ???SetData functions (typSetData, sysSetData, etc.). You should be able to set and access hundreds of variables without performance problems. Once you start crossing into thousands of variables, I think you'll see problems.catfighter wrote:Should I instead set a global variable operable throughout the entire universe? I'm hesitant to do so, however, because if enough were set I feel sure the game would get rather clunky and could possibly have lag.
If you describe what you're trying to do, we might be able to come up with concrete suggestions.
- catfighter
- Militia Commander
- Posts: 466
- Joined: Fri Nov 08, 2013 5:17 am
- Location: Laughing manically amidst the wreckage of the Iocrym fleet.
I want to track multiple stations and ships and states throughout several systems, but it shouldn't get over a thousand variables.
I'm thinking about making a very choice-dependent mod. Destroying anything in a one system will have an impact in every other system (ie kill a base or capital ship, set baseDestroyed="true" and there's a firing squad waiting at every gate). I also wanted to have wingmen who could "perform" missions in other systems. For example, tell someone "go kill so-and-so" and the game will have them will gate out and then set a timer with a random chance of them getting "hit" in combat with the enemy or "destroying" their target (this would need to change the station/ship into a wreck and set the station's specific baseDestroyed variable to "true" from whatever system the player happens to be in). I'm pretty sure it would cause problems to attach the variable to any specific entity if the player did something like gating or dieing/resurrecting.
I'm thinking about making a very choice-dependent mod. Destroying anything in a one system will have an impact in every other system (ie kill a base or capital ship, set baseDestroyed="true" and there's a firing squad waiting at every gate). I also wanted to have wingmen who could "perform" missions in other systems. For example, tell someone "go kill so-and-so" and the game will have them will gate out and then set a timer with a random chance of them getting "hit" in combat with the enemy or "destroying" their target (this would need to change the station/ship into a wreck and set the station's specific baseDestroyed variable to "true" from whatever system the player happens to be in). I'm pretty sure it would cause problems to attach the variable to any specific entity if the player did something like gating or dieing/resurrecting.
Behold my avatar, one of the few ships to be drawn out pixel by pixel in the dreaded... Microsoft Paint!
Day 31: "I have successfully completed my time reversal experiment! Muahahaha!!!"
Day 30: "I might have run into a little problem here."
Day 31: "I have successfully completed my time reversal experiment! Muahahaha!!!"
Day 30: "I might have run into a little problem here."
IIRC, things like that are implemented by setting certain variables of gPlayerShip to certain values at the moment.I'm thinking about making a very choice-dependent mod. Destroying anything in a one system will have an impact in every other system (ie kill a base or capital ship, set baseDestroyed="true" and there's a firing squad waiting at every gate). I also wanted to have wingmen who could "perform" missions in other systems. For example, tell someone "go kill so-and-so" and the game will have them will gate out and then set a timer with a random chance of them getting "hit" in combat with the enemy or "destroying" their target (this would need to change the station/ship into a wreck and set the station's specific baseDestroyed variable to "true" from whatever system the player happens to be in). I'm pretty sure it would cause problems to attach the variable to any specific entity if the player did something like gating or dieing/resurrecting.
You can find an example of that in, um, commonwealth.xml maybe? I don't remember the file's name, but it's sets the fine player ought to pay for destroying stations or ships.
So I guess you can make it as follows:
Code: Select all
<OnDestroyed>
(block (Nil)
(objSetData gPlayerShip "station_5_destroyed" 1)
1
)
</OnDestroyed>