Random items but same level in box

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
DigaRW
Militia Captain
Militia Captain
Posts: 517
Joined: Thu Jul 30, 2015 3:10 pm
Location: The place where I belong
Contact:

You know Joker Box mod? I want to reworking that mod and turn it into Strongbox mod. I'm using the code from contraband box, but I don't know the code that will add one (only one) items, and it has same level with the box. So, what the code?
Download Transcendence mods from Reinvented Workbench Project!
Click this link!
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?

Try (objAddItem obj item|type [count])
(objAddItem gPlayership (ItmCreate &ITEMUNIDHERE; 1))
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
DigaRW
Militia Captain
Militia Captain
Posts: 517
Joined: Thu Jul 30, 2015 3:10 pm
Location: The place where I belong
Contact:

RPC wrote:Try (objAddItem obj item|type [count])
(objAddItem gPlayership (ItmCreate &ITEMUNIDHERE; 1))
Where?
Download Transcendence mods from Reinvented Workbench Project!
Click this link!
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?

How do you want to add the item? You can check out dock screens for reference when you buy items.
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
DigaRW
Militia Captain
Militia Captain
Posts: 517
Joined: Thu Jul 30, 2015 3:10 pm
Location: The place where I belong
Contact:

RPC wrote:How do you want to add the item? You can check out dock screens for reference when you buy items.
I mean the box contain random items that have same level with it.
Example:
-If Box contain MajorItem.
The level 1 Strongbox will give one random device like Laser Cannon, Recoilless Cannon, Class I Deflector, and Laser Collimator.
-If Box contain MinorItem
The level 1 Strongbox will give four (default) random items, like titanium armor, light titanium armor, and Ablative barrel.
Download Transcendence mods from Reinvented Workbench Project!
Click this link!
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

Let's try this :

it's an Item, yes?

you can do it two ways:

A) as Events on the Item

B) as part of the Use (Invoke ) / dock screen ( ammo boxes / sealed cargo container )

First Question is " what is in there?"

you suggest Armor .....ok, Unless you want VERY specific items to be given you can go with a random pull ( StdTypes.xml )

If you want specific items only : you can build your own table &trMyStuff; ( like with weapons or ships ) and have them pull up based on chances.


now here is the easiest way to get this done if we are not being very helpful :
Give us what you have for the item : so we can see what you are working with and that will make our 'help' more useful.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
User avatar
DigaRW
Militia Captain
Militia Captain
Posts: 517
Joined: Thu Jul 30, 2015 3:10 pm
Location: The place where I belong
Contact:

Nah, the box contain random items, but the items same level with the box. I want it can stick with other mod so their items was included in the box.
But however, I recently have made it myself. The frequency set them to stick with their level.
Example:
I'm made a White StrongBox, with the code in the items:

Code: Select all

<Invoke>
(block (count strongBoxItems) 
(setq strongBoxItems (itmCreateRandom "* +MajorItem;" "c---- -----"))
(setq strongBoxItems (itmCreate (itmGetType strongBoxItems) 1))

(objAddItem gSource strongBoxItems)

(objRemoveItem gSource gItem 1))
</Invoke>
But I have no idea to place "or" code, so the box will give either MajorItem (count 1) or MinorItem (count 4).
Last edited by DigaRW on Wed Jun 01, 2016 12:28 am, edited 2 times in total.
Download Transcendence mods from Reinvented Workbench Project!
Click this link!
User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1190
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

 I think the way you would have to do it would be with an “if” before you actually did the item creation code. Something like:

Code: Select all

(if (eq (random 1 2) 1)
  «MajorItem creation code»
  «MinorItem creation code»
)
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)
User avatar
DigaRW
Militia Captain
Militia Captain
Posts: 517
Joined: Thu Jul 30, 2015 3:10 pm
Location: The place where I belong
Contact:

AssumedPseudonym wrote: I think the way you would have to do it would be with an “if” before you actually did the item creation code. Something like:

Code: Select all

(if (eq (random 1 2) 1)
  «MajorItem creation code»
  «MinorItem creation code»
)
Thanks AP, I'll try it.
Download Transcendence mods from Reinvented Workbench Project!
Click this link!
Post Reply