Coding help

Freeform discussion about anything related to modding Transcendence.
Post Reply
OutXider
Anarchist
Anarchist
Posts: 1
Joined: Sun Jan 27, 2008 2:21 am
Location: Las Vegas

Hello I'm new here but I've been lurking around for a while now. Been modding my own mod for like the past 2 weeks straight and I seem to have gotten down the editing of the ships and weapons, but I still don't understand that <invoke block nil> stuff. I was trying to make one of my weapons handicapped by making it have charges and those charges would recharge over time. I had something like

Code: Select all

<Event>
<block nil
(sysAddObjRecurringTimerEvent 100 gplyership "Recharge")
<block recharge
(shpRechargeItem gplyership "wI" 1)
Or something like that. I'm not sure cause I deleted it when it wouldn't work.

Also I was going to have one ship keep one main weapon but was upgradeable with device enhancements. Basically the weapon was virtual but there were device slots that I can install items that affect the weapon specifically. Any idea how I can go about doing that?
Image
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

events can be named anything you want but some will be called by the game under certain circumstances.

Code: Select all

<Events>
	<OnCreate>
		(sysAddObjRecurringTimerEvent 100 gplayership "Recharge")
	</OnCreate>	
</Events>
That will call a event named Recharge in the player ship every 100 seconds after the station or ship that has this code in it is created.

for example

Code: Select all

<Events>
	<Recharge>
		(shpRechargeItem gplayership (random (objGetItems gplayership "wI")) 1)
	</Recharge>
</Events>
If that is in your player ship then a random installed weapon will be recharged by 1 every 100 ticks.
Crying is not a proper retort!
Post Reply