Latest batch of Modding questions

Freeform discussion about anything related to modding Transcendence.
Post Reply
Burzmali
Militia Commander
Militia Commander
Posts: 395
Joined: Tue Aug 15, 2006 12:14 am

I guess this is directed to George, or anyone else who has dealt with these problems. All of these issues arose while I was modding the radiator finned laser cannon for OddBob in the Hard Science Conversion thread.

1. Is there a way to phrase an (objEnumItems ...)'s criteria to pick up virtual items? I was trying to make the weapon component of that device a virtual item, and I could create and install it as a virtual, but I couldn't "find" it later to unistall/remove it.

2. Is there a way to reference the <Events> section of an <ItemType> definition from an <Invoke>? In the example in the other thread, I was forced to include the Event logic in the ShipClass.
Burzmali
Militia Commander
Militia Commander
Posts: 395
Joined: Tue Aug 15, 2006 12:14 am

Bump, for great justice.
User avatar
evilbob
Militia Captain
Militia Captain
Posts: 555
Joined: Sun Mar 05, 2006 1:23 pm

You know what you doing?
User avatar
dvlenk6
Militia Captain
Militia Captain
Posts: 519
Joined: Sun Mar 05, 2006 6:56 am
Location: Sanctuary and beyond
Contact:

I think he knows what he's doing. :wink:
"War is hell."
-William Tecumseh Sherman
http://dvlenk6.blackraven3d.com/transgals.html
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Burzmali wrote: 1. Is there a way to phrase an (objEnumItems ...)'s criteria to pick up virtual items?
Unfortunately, there is not. But I will add a new flag that includes virtual items for all places that take an item criteria filter (including objEnumItems).

Burzmali wrote: 2. Is there a way to reference the <Events> section of an <ItemType> definition from an <Invoke>? In the example in the other thread, I was forced to include the Event logic in the ShipClass.
I'm not sure what you mean here. Reference how? Do you want to invoke a piece of code in <Events>?
Burzmali
Militia Commander
Militia Commander
Posts: 395
Joined: Tue Aug 15, 2006 12:14 am

On 2, here is an example.

Code: Select all

<ItemType UNID="&itMyItem;"
.
.
.
>
  <Invoke>
  .
  .
  .
  (sysAddObjTimerEvent 3600 !obj! "OnMyTimer")
  .
  .
  .
  </Invoke>

  <Events>
    <OnMyTimer>
    .
    .
    .
    </OnMyTimer>
  </Events>
</ItemType>
The question I have is, is there a value for !obj! that will cause <OnMyTimer> to trigger?
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

I get it now.

I will need to add a new function, because you will need both the object and the item as parameters.

Something like,

Code: Select all

(sysAddObjItemTimerEvent 3600 gSource gItem "OnMyTimer")
I think both gSource (the object) and gItem are necessary. I'll add this to the next version.
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

BTW, I'm also thinking of adding more built-in events for installed items:

<OnInstall> Gets called when the item is installed (and perhaps the script can return a code that prevents the installation)

<OnUninstall> Gets called when the item is uninstalled (and, again, the script can prevent uninstallation)

<OnUpdate> Gets called every update (for performance I will probably restrict this so that it only gets called every 10 ticks).

<OnFire> Gets called for weapons when the weapon fires.

Would that help your mod? In other words, would those events be enough to do your mod without requiring a virtual item?
Burzmali
Militia Commander
Militia Commander
Posts: 395
Joined: Tue Aug 15, 2006 12:14 am

Well, the trick is making a weapon that enables and disables on an invoke and changes from internal to external. Mind you that it is OddBob's project that I created the mod for.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

OnInstall and OnUninstall would be great for "living" items so that they can't be easily uninstalled

OnFire would be great for a weapon that damages your own shields

one request though can there be a OnActivate and OnDisable so we can have effects happen on those events
Crying is not a proper retort!
Post Reply