Modding help.

Freeform discussion about anything related to modding Transcendence.
Post Reply
e_____e
Miner
Miner
Posts: 33
Joined: Sun Sep 30, 2007 6:40 pm

From my mod-in-progress:

Code: Select all

			<!-- Sovereign: Collective -->

<Sovereign UNID="&svCollective;"
		name="Collective"
		alignment="destructive chaos"
		>

	<Relationships>
		<Relationship sovereign="&svPlayer;" disposition="neutral"/>
		<Relationship sovereign="&svReplicator;" disposition="neutral"/>
		<Relationship sovereign="&svDeviant;" disposition="enemy"/>
	</Relationships>
</Sovereign>

			<!-- Sovereign: Deviant -->

<Sovereign UNID="&svDeviant;"
		name="Deviant"
		alignment="constructive chaos"
		>

	<Relationships>
		<Relationship sovereign="&svPlayer;" disposition="neutral"/>
		<Relationship sovereign="&svCollective;" disposition="enemy"/>
		<Relationship sovereign="&svReplicator;" disposition="enemy"/>
	</Relationships>
</Sovereign>

			<!-- Sovereign: Replicator -->

<Sovereign UNID="&svReplicator;"
		name="Replicator"
		alignment="destructive chaos"
		>

	<Relationships>
		<Relationship sovereign="&svPlayer;" disposition="neutral"/>
		<Relationship sovereign="&svCollective;" disposition="neutral"/>
		<Relationship sovereign="&svDeviant;" disposition="enemy"/>
	</Relationships>
</Sovereign>
So, I'm assuming that neutral is the same as ally, right? Are there any more things I can do with sovereigns?

Code: Select all

	<Invoke key="S">
		(block Nil
			(setq pos (sysVectorPolarOffset gSource 0 0))
			
			(enum (sysFindObject gSource "sEN:50; B:collectiveShip;") target
				(for i 0 1
					(block (ship)
						(setq ship (sysCreateShip &scCollectiveDreadnought; pos &svFriendlyAuton; "auton"))
						(shpOrderAttack ship target)
						)
					)
				)
			)
	</Invoke>
Why is it that, when I invoke this item, around 10 ships are spawned instead of only one? Why is it that when I remove the (for i 0 1

Code: Select all

 ) it doesn't work?

Also, well.. how about an example? How do I make it so that you dock at a base, you click an option ("sabotage") and the station loses some weapon or device?

Thanks in advance.
User avatar
dvlenk6
Militia Captain
Militia Captain
Posts: 519
Joined: Sun Mar 05, 2006 6:56 am
Location: Sanctuary and beyond
Contact:

enum is a loop.
I'd say off hand that the script is generating two ships for each target:
Each enum 'target' item is running the (for i 0 1...) loop; which will generate two ships each time.

This is an item?
You should have a check, in case there is no target found.
(shpOrderAttack ship target) with Nil for 'target' might crash the game.

Try this, or some variant:

Code: Select all

<Invoke key="S">
	(block (pos target)
		(setq pos (sysVectorPolarOffset gSource 0 0))
		(setq target (random (sysFindObject gSource "sEN:50; B:collectiveShip;")))
		(if target
			; if target found make a ship
			(block (ship)
				(setq ship (sysCreateShip &scCollectiveDreadnought; pos &svFriendlyAuton; "auton"))
				(shpOrderAttack ship target)
			)
			; else do nothing
			Nil
		)
	)
</Invoke>
If this is an item that is intended to be used up when it is used, you need to put this on a line after the ship is created, inside the '(block (ship)...):

Code: Select all

(objRemoveItem gSource gItem 1)
EDIT - The item is creating a 'Collective Dreadnought'?
"War is hell."
-William Tecumseh Sherman
http://dvlenk6.blackraven3d.com/transgals.html
e_____e
Miner
Miner
Posts: 33
Joined: Sun Sep 30, 2007 6:40 pm

Yes, a ship in my mod.
Post Reply