Player Summoning a ship

Freeform discussion about anything related to modding Transcendence.
Post Reply
Peter
Commonwealth Pilot
Commonwealth Pilot
Posts: 91
Joined: Wed May 07, 2014 1:11 am
Location: New Zealand

Wed Mar 23, 2016 1:40 pm

I've been trying to allow the player to summon another ship, but I can't quite get it working.

Code: Select all

(sysCreateShip "&scHornet;" gSource)
This is my code. It's properly put inside an <Event> Function, I just need help getting this to work :P

What I want to do is summon a hornet on top of the player, which is allied with the player.

Thanks
My dream is to one day discover that someone who plays transcendence lives near me and goes to my school. Then I can finally have a friend.
---
Why must I keep running into that wall, impossibility?

User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 363
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Wed Mar 23, 2016 2:09 pm

You should make an item like auton item, but it set to be unlimited. So when you "use" that item, it will not deleting that item.
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.37
Great corporate that feature a new items and challenges!
YourCORP v1.16
Build your very own corporation!
Trade Item Extension v1.15
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.6
New weapons that have very unique abilities!
Click this link!

Peter
Commonwealth Pilot
Commonwealth Pilot
Posts: 91
Joined: Wed May 07, 2014 1:11 am
Location: New Zealand

Wed Mar 23, 2016 4:02 pm

Unfortunately that won't work for me for what I'm trying to do. I'm trying to make an event which triggers when your shield down. It is meant to summon some allied ships. I've got everything working but the summoning, aka almost nothing xD
My dream is to one day discover that someone who plays transcendence lives near me and goes to my school. Then I can finally have a friend.
---
Why must I keep running into that wall, impossibility?

gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

Wed Mar 23, 2016 4:17 pm

Have you tried using an encounter? Here's code from one of my mods that you're welcome to modify for your own purposes:

Code: Select all

		<Events>

			<OnGlobalPlayerEnteredSystem>
				; Using gPlayerShip instead of gSource and vt064PirateOwnerBeacon instead of gItem
				; based on what George said in a forum thread from 2014:
				; "The main problem is that _OnGlobalSystemCreated_ is a "global" event, which means it runs outside of the context 
				; of any particular object. Specifically, gSource will be Nil when it runs."
				(block Nil
					; (objSendMessage gPlayerShip Nil "Player entered system!") USED FOR DEBUGGING PURPOSES
					(if gunship256_readyForSolarOwnerAttack
						(block Nil
							(sysAddEncounterEventAtDist 120 gPlayerShip &etSolarOwnerAttack; 50)
							(sysAddEncounterEventAtDist 300 gPlayerShip &scCorsairIIAttack; 50)
							(objRemoveItem gPlayerShip (itmCreate &vt064PirateOwnerBeacon; 1))
							(setq gunship256_readyForSolarOwnerAttack Nil)
							)
						)
					)
				</OnGlobalPlayerEnteredSystem>
			</Events>

Code: Select all

	<EncounterTable UNID="&scCorsairIIAttack;">
		<Ship class="&scCorsair-II;"	count="3" orders="attack"	sovereign="&svPirates;"/>
		</EncounterTable>
		
	<EncounterTable UNID="&etSolarOwnerAttack;">
		<Ship class="&scSolarOwner;"	count="1" orders="attack"	sovereign="&svPirates;"/>
		</EncounterTable>

Peter
Commonwealth Pilot
Commonwealth Pilot
Posts: 91
Joined: Wed May 07, 2014 1:11 am
Location: New Zealand

Wed Mar 23, 2016 4:46 pm

Thanks for the help! I might do that if I run in to troubles, but Digdug helped me over on the IRC :)
Thanks anyway though!
My dream is to one day discover that someone who plays transcendence lives near me and goes to my school. Then I can finally have a friend.
---
Why must I keep running into that wall, impossibility?

gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

Fri Mar 25, 2016 4:13 am

Peter wrote:Thanks for the help! I might do that if I run in to troubles, but Digdug helped me over on the IRC :)
Thanks anyway though!
Great! I'd be interested in taking a look at the mod when you're finished to see how you solved the problem. Are the ships escorting your ship or just appearing and then defending themselves from hostiles?

Peter
Commonwealth Pilot
Commonwealth Pilot
Posts: 91
Joined: Wed May 07, 2014 1:11 am
Location: New Zealand

Fri Mar 25, 2016 6:43 am

Great! I'd be interested in taking a look at the mod when you're finished to see how you solved the problem. Are the ships escorting your ship or just appearing and then defending themselves from hostiles?
I was mostly doing it out of curiosity, I didn't end making a mod out of it yet, but I might in future. Here is the code I used:

Code: Select all

(block (theSentinel)
									(setq theSentinel (sysCreateShip &scIocrymSentinel; gSource &svFriendlyAuton;))
									(shpOrder theSentinel 'escort gSource)
									(shpOrderImmediate theSentinel 'attack (sysFindObject gSource "sEN"))))
This is basically the code the Iocrym command ship uses (I based it off that, I haven't even changed the ship it spawns, it still spawns Iocrym sentinels xD). The orders tell the sentinel spawned to escort me, but then instantly tell them to attack objects matching the sEn criteria (just in case you don't know what that means, go to the http://wiki.kronosaur.com/modding/function/legend page under the criteria section). Once they've finished that, they'll come and escort me again until another enemy appears. This basically makes them hyper-aggressive autons :D.

If I actually make this into a mod (I am planning to do this some time), then I'll make them self destruct after killing all enemies in the vicinity, instead of following you and repeating the process once another enemy appears.
My dream is to one day discover that someone who plays transcendence lives near me and goes to my school. Then I can finally have a friend.
---
Why must I keep running into that wall, impossibility?

Peter
Commonwealth Pilot
Commonwealth Pilot
Posts: 91
Joined: Wed May 07, 2014 1:11 am
Location: New Zealand

Fri Mar 25, 2016 6:44 am

Also I'm on 49 wiki posts so I'm just going to send this to see if I get upgraded to commonwealth pilot...

Yup it worked :)
My dream is to one day discover that someone who plays transcendence lives near me and goes to my school. Then I can finally have a friend.
---
Why must I keep running into that wall, impossibility?

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1483
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Sat Mar 26, 2016 6:06 pm

Peter wrote:Also I'm on 49 wiki posts so I'm just going to send this to see if I get upgraded to commonwealth pilot...

Yup it worked :)
Being a "Commonwealth Pilot" just means you haven't died enough :)

I look forward to you Joining Fleet Ranks.

I will leave the note that "Fuel Contracts", "Crew Members" & "Mercenaries" or " Mercenary escorts" have been done and summon ships to the player by use if Items or Insurance protections.

However, adding code to the Playership , as you suggested, can be a very Great Proposal, even better if you make sure that "if" you post it for the rest to experience, to include it in "Newbie Boost" so newer players to the Mods Use on xelerus can grab hold of your work faster.

I do hope your experiments work out well for you.

btw, Re: your signature :
the "wall" only has the power you give it:

Code: Select all

 OnjSetProperty Nil
nothing will stand in your way of Greatness.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

Peter
Commonwealth Pilot
Commonwealth Pilot
Posts: 91
Joined: Wed May 07, 2014 1:11 am
Location: New Zealand

Sat Mar 26, 2016 6:33 pm

btw, Re: your signature :
the "wall" only has the power you give it:

Code:
OnjSetProperty Nil
nothing will stand in your way of Greatness.
I don't think that code would work. Doesn't it have to be

Code: Select all

ObjSetProperty
xD
I do hope your experiments work out well for you.
Thanks! Currently working on it pretty slowly as I just recently got both Corporate command and Eternity port, and am busy using most of my time playing through them :)
My dream is to one day discover that someone who plays transcendence lives near me and goes to my school. Then I can finally have a friend.
---
Why must I keep running into that wall, impossibility?

Post Reply