Dynamic Systems

Freeform discussion about anything related to modding Transcendence.
Post Reply
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

I think I know what happened. I used

Code: Select all

(objSetData gSource "orderTarget" (setq test (objgetid aDestroyer)))

And got 619.
However, I used

Code: Select all

(setq prevTarget (objGetData gSource "orderTarget))
in the OnDestroy tag and got "nil". Maybe the data is cleared (because the ship is replaced with a destroyed version of itself)? I'll see what happens if I use aWreck.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

You need to use objgetobjbyid to turn the index stored by objgetid back into an actual object.

You can't store objects directly in persistent data because they get trashed every time you save the game.
Literally is the new Figuratively
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

RPC wrote:I think I know what happened. I used

Code: Select all

(objSetData gSource "orderTarget" (setq test (objgetid aDestroyer)))

And got 619.
However, I used

Code: Select all

(setq prevTarget (objGetData gSource "orderTarget))
in the OnDestroy tag and got "nil". Maybe the data is cleared (because the ship is replaced with a destroyed version of itself)? I'll see what happens if I use aWreck.
Is gSource correct? I thought your original code stored the data in "theLeader" or something. [My example was just an example--you have to apply it to your situation.]

Remember that you are storing data on an object. Try to make sure that you are reading the data from the same object. Making sure that the value of the first parameter of objSetData and objGetData are identical.
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

George: Yes... you're right. I got it working today, but I don't know how....
The changes in the event handler were:

Code: Select all

<OnDestroy>
				;; check if this ship is the leader
				(if (objGetData gSource "teamLeader") 
					(block (escorts prevOrder prevTarget)
						;; get the ships currently escorting destroyed ship
						(setq escorts (sysFindObject gSource "sO:escort"))
						
						;prev orders + target
						(setq prevOrder (objGetData gSource "shipOrder"))
						(setq prevTarget (objGetData gSource "orderTarget"))

						;; only proceed if we have any escorts left
						(if escorts 
							(block (newleader test)
								;; the first becomes the new leader
								(setq newleader (item escorts 0))
								;; designate the ship as teamLeader
								(objSetData newleader "teamLeader" true)
								;; give the new leader some useful order
								;; (cancel any previous ones first)
								(shpCancelOrders newleader)
								(shpOrder newleader 'attack prevTarget)
								(plyMessage gPlayer "PrevTarget is "prevTarget"!")
								;set Target again for the next leader
								(objSetData newLeader "orderTarget" (objGetData gSource "orderTarget"))
								(plyMessage gPlayer "Next leader's targ is "prevTarget"!")
								
								;; if there are any more ships, tell them to escort newleader
								(enum (subset escorts 1) s 
									(block nil
										(shpCancelOrders s)
										(shpOrder s 'escort newleader)
										)
									)
								)
							)
						)
					)
			</OnDestroy>
The changes in the event itself were:

Code: Select all

;here is the inserted code to get fleets
					;give retaliation ship this event
					(objSetEventHandler theLeader &evRetaliationEventHandler;)
						;set the teamLeader status
						(objSetData theLeader "teamLeader" true)
						;get ShipOrders from previous leader
							;ObjSetData- what?
								;order
								(objsetdata theLeader "shipOrder" 'attack)
								;target
								(objSetData theLeader "orderTarget" (setq test adestroyer))
								
					;order the leader to wait so the squad forms up-- taken from evStdConvoyEncounterBehavior
					(shpOrder theLeader 'wait 10)
I changed (objSetData theLeader "orderTarget" (setq test (objgetid adestroyer))) to
(objSetData theLeader "orderTarget" (setq test adestroyer))
and changed all the gSource to the appropriate ship.
I also made it so that newleader stores the target in itself, allowing the next leader to continue until the squad is dead. (a chilling thought, huh?)
and... it works. I don't know why.
As for ObjSetData/objGetData, it also returns numbers, which what RPC[insertfactionname]Retaliationlevels were.

Now onto Sung events! Getting slaves sounds like a MUCH harder thing to code.....
Any ideas anybody?
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Does capitalization count for attributes?
I had "Notrandom" for an attribute for one of my reactors, but found it anyways in a Vanilla game.
I then used Find and Replace to change "Notrandom" to "NotRandom".
Maybe I should use

Code: Select all

frequency=			"notrandom"
if I don't want things showing up in-game?

Also, is there a way to show "damage" (when the ships get the black marks on them) in code?
I want to use another event handler that uses <OnDestroy> so that you get survivors on a destroyed ship, with the ship becoming immobile, and change its weapon to omnidirectional.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

MY idea was that you take the Escape ships and add one ( I managed to do that ) but have it run :" avoid " enemy
and drop a kit ( cargo box / drop container: whatever you want to call it )that on drop ( onFireInvoke) it deploys a new station ( i deploy stations in my game off my ship: so I know it can be done: just getting a ship other then a player ship to do it is the main drain on my cocoa cup because I am not a Mod Maker: but I wanted to try to find something useful since I enjoy DySy.
( example idea, the code is for a carrier : I think everything is already in the code for the game: it's just moving it around to apply for different items ..then hope the game thinks you knew what you were doing so it does not ignore you...)
(setq fltOrderCheckPosition (lambda (theShip)
(block (enemyObj)
; Are we in a good spot? If not, then we need to move
(if (and (setq enemyObj (sysFindObject theShip "TAEPN"))
(leq (objGetDistance theShip enemyObj) 80)
)
(block (dest bearing)
; bearing away from enemy
(setq bearing
(sysVectorAngle (sysVectorSubtract (objGetPos theShip) (objGetPos enemyObj)))
)

; Pick a better spot that is away from the enemy
(setq dest (sysVectorRandom theShip
(lambda Nil
(sysVectorPolarOffset Nil
(modulo (add bearing 360 (random -80 80)) 360)
(random 120 180)
)
)
100
"TA"
))
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Shane: You suggest I should have Escape pods drop stations?
I might tone it down to Escape pods dropping mines, but that kind of defeats the whole purpose of escaping (as in the stealthy part of it-- I think I'll equip the escape pods with stealth armor in the next release so that they don't get shot at). I mean, if you're running away from a Phobos that just killed your Aquila, I don't think you'd want to attract attention by spamming mines.

Code: Select all

Captain: Release the mines!
Private: Sir, our Class I shields won't stand a chance against lightning turrets!
No, don't do it! ....shhsshshshshs..
</transmission ends>
Also, I have no idea what the code you posted is used for....
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

I was talking of a station being destroyed, not the ships : your stations deploy escape pods, right?

I was assuming that they were since the ships do , the stations would as well : I never actually checked your code to see if they do ,

To get you the Understanding of what I am talking about I will let you play with my toys.....Civilian Service Assemblies :
.http://paste.neurohack.com/view/YQB59/
Put these items on your ship : deploy them : THEN consider how valuable they can be to the DySy ( for any Faction ) if a Lone ship escaped, a Ronin, Sandstorm, etc and dropped one of these to replace a destroyed station
The two stations are Civilian Service Assemblies : Volunteers in a box, basically .
http://paste.neurohack.com/view/YQB59/
The package is a simple thing : drop it and it unpacks into a beautiful Craft Museum or Flight School, I think there is a Tree Museum in there too......The Pre-war Museum is really nice, I go there for Hot Cocoa ......:) joking : they just buy , sell and do dock services: no clubs.
----------------------- THE STATIONS package does not carry a UNID ( I am not a Mod Maker, I do not have a UNID ) so you have to set that up with your numbers .---------------------------

And the code I was thinking of ( posted earlier ) to help the ship deployed to drop the new station away from the area of Hostiles:
it comes from the CSC orders for the carrier ship position finding when the system is loaded : you have seen them moving away from Hostile stations to take up a position that they later hold for the rest of the game ( thats the code that moves the ship away from the hostile stations ) and I thought it might be able to apply to the ship behavior of the ship that escapes the station to deploy the new station.....
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

I can see where you are going with this!
So to rebuild a station, how about I have a freighter (say... a scarab) that gates in, then is escorted by a fleet of Britannias. Then it uses the item to spawn a station that has a half-built look (I'm thinking about using the Korolov in Charon right now) and is guarded by the Britannias. After a while, the station is fully built and then after more time passes by, can specialize to a CW fortress or another level appropriate station.
Things to work out:
1.That's a good idea to add the escape pod event to stations... The only thing is I don't know if the Ares or other factions use Earthzones.
1a. Same with the freighter---I don't know which freighters to use for Teratons and such--- although I could just use the scarab as a multi-purpose freighter.
2.If I have a new station to take over the old one, how will I make sure they have the same name?
3.When I change stations, how will I ensure that the Britannias will guard the new station?
4.If a station is built in the way you mentioned (syscreatestation) they also come with ships... That makes no sense in a "rebuilding" context. I'll have to find a way to spawn the station on it's own and get guard ships to gate in.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

ok: so giving you the toys DID help you see my idea better:)

( remember: my stuff runs on borrowed Unids for testing : so you got to add your own to the code to make it run )
http://paste.neurohack.com/view/YdghU/
Here is two versions of the V6: commonwealth and Ares made ( but the Sov is set at Settlers because I was testing it in the early game & it carries the name "Steve" because I was thinking of the Radio operator for the Distress calls) : I watched them battle each other: the Ares Model won, It ALSO Killed me and I had a Corporate Enforcer!!
Commonwealth Fleet rank Civilian
Domina relationship Novice
Fate Destroyed by the Orthodoxy Freighter in the Ras Alhague System
Ship class Enforcer-class cruiser

These are AntaresV based: so they are hard to kill from the start : I do believe that if a Chasm can escape the Ranx in Lumen,
Then these ships can escape death long enough to drop a package.
( BTW: if you test the Ares Made version with a Hostile Sovereign description: borrow the shield from Shenlong : the Ares were not playing around when they built it to fight the CW : in an ordinary game , as an Ares ship, the player should be able to beat it with the weapons/ shields for the level that Ares Spawn ( and it needs a few nice trinkets in the cargo hold : it is going to be one heck of a fight so it will need a reward. it is kind of a Vjor of the Deimos ( forerunner ) and good practice for a player )
++++++++++++++++++
Changing item images: the code for that I saw: Playership Drones switches the Wreck Images to a repaired Image : you can adapt that concept to a timing tick for changing the images of the station. Being as the Station is only changing , not setting off the <ondestroy> codes, the guards will hold position .
+++++++++++++++++++++++++++++
Sovereign Escape Pods: I would just Default to their own ships : Ares=Sandstorm, Ranx = Gunships;
I was thinking earlier that the teratons need ships ( how did they get there in the first place? ) but for them Id use the Ares polar
Because its the Most Common ship visiting their Nest and the game would not choke on putting another Polar connected with them.

Ringers have a ship : the Huygens Explorer : armed and dangerous ( but weak shielded in my opinion, I don't know if it can escape the Ranx or Ares long enough to drop a package, even if it gates in it has a LONG drive to reach a safe spot.
+++++++++++++++
As for my stations being " ready made with ships " : I am far from as brilliant as a Mod Maker, i take what I can make work :)

But YES: I think you have the best solution there : ships that gate-in : which happens all the time in your retaliations/ attacks in DySy : so it would fit in perfect with the way the code operates .....
+++++++++++++++++++++
1a. Same with the freighter---I don't know which freighters to use for Teratons and such--- although I could just use the scarab as a multi-purpose freighter.
2.If I have a new station to take over the old one, how will I make sure they have the same name?
I have to page back and forth to read: forgot these:

the Scarab is running at.........mass="20000";thrust="2000";maneuver="20";maxSpeed="6"

No way it will survive a DySy game for more then three minutes at THAT speed : if it clears a gate at all in a DySy game : If you do use it ( or thre image of it ) : I suggest modifying it so it can handle or move fast enough away from the Hostilities that it might face on it's Gate In.

name for that sovereign / station.
commonwealth / Corporate stations are the only ones with differing names to stations and most just take the station type or system+station name, they are not very creative ( unlike my stations and the V6 : they can pick their own from the list):
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

So.... I have these zombies in Transcendence, and they just keep on infecting other ships.
I want them to exhibit hoarding bahavior and guarding the gate to infest others, but it leads to a loop where all of them become infected, and since stations keep calling for more ships, which get infected, and then the stations call for more ships.....

How do I stop this?
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
Drako Slyith
Fleet Officer
Fleet Officer
Posts: 1036
Joined: Wed Feb 03, 2010 4:28 am
Location: Researching how to make St. Kats star go supernova.
Contact:

Does the infection spread through shots? If so, you could change the fire accuracy in the AI settings to a very low number ~5-10 this means that about 5% of the shots are in line. They fire really, really badly. If they spread through another means, then try when you order them to patrol around the stargate, maybe have an equation so the more ships there are, the further away they patrol from the gate. These are just some ideas to make some ships able to slip through.
Image
Image
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Infectious zombies behaving in a tactically sound manner? Of course they convert everything. You pretty much either have to accept that or get rid of the tactically sound behavior. Or drop the infection rate on a successful hit down to the single digit percents. Tenths of a percent if certain ships aren't made immune to infection.
Literally is the new Figuratively
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Lowering infection rates should be a good start.
I'm currently thinking of a CW extermination squad with counter-AI to the zombie AI and having the ships have resistant shielding.

I also keep breaking my game, but they only break at Eridani, St. Kat's, and PJ. I'm thinking that stealing ships is messing with the events because they don't get registered properly.
Example:

Code: Select all


program state: OnAnimate
program state: updating object
obj class: CShip
obj name: Tieren Mk I-class mobile suit
obj pointer: 2b43c10
CStandardShipAI
Order: 14
m_State: 3
m_pDest: none
m_pTarget: 2b3fa88 Mayfly-class Capitalist-ForTrans (CShip)
m_pNavPath: none
game state: in game
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Okay, the interval between crashes is getting shorter, so here's my code:
EDIT* Thanks sdw for reminding me about pastebin. The link is on my latest post.
I want someone to check out what's wrong with it, because it crashed in LV42whatever and my previous hypothesis was wrong.
and the error is here:

Code: Select all

program state: OnAnimate
program state: updating object behavior
obj class: CShip
obj name: Flooded
obj pointer: a28c6d0
CStandardShipAI
Order: 12
m_State: 1
m_pDest: none
m_pTarget: a28c548 Ranx gunship (CShip)
m_pNavPath: none
game state: in game
Curiously, the program state is always updating something when it crashes.
Last edited by RPC on Tue May 17, 2011 12:10 am, edited 1 time in total.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
Post Reply