Random items but same level in box

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 333
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Mon May 30, 2016 6:34 am

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!
Semesta I.G.C v1.34
Great corporate that feature a new items and challenges!
YourCORP v1.11
Build your very own corporation!
Trade Item Extension v1.14
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.3
New weapons that have very unique abilities!
Click this link!

User avatar
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?

Mon May 30, 2016 9:22 am

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 Commander
Militia Commander
Posts: 333
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Tue May 31, 2016 2:31 am

RPC wrote:Try (objAddItem obj item|type [count])
(objAddItem gPlayership (ItmCreate &ITEMUNIDHERE; 1))
Where?
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.34
Great corporate that feature a new items and challenges!
YourCORP v1.11
Build your very own corporation!
Trade Item Extension v1.14
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.3
New weapons that have very unique abilities!
Click this link!

User avatar
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?

Tue May 31, 2016 8:02 am

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 Commander
Militia Commander
Posts: 333
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Tue May 31, 2016 9:36 am

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!
Semesta I.G.C v1.34
Great corporate that feature a new items and challenges!
YourCORP v1.11
Build your very own corporation!
Trade Item Extension v1.14
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.3
New weapons that have very unique abilities!
Click this link!

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

Tue May 31, 2016 2:42 pm

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 Commander
Militia Commander
Posts: 333
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Tue May 31, 2016 3:54 pm

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!
Semesta I.G.C v1.34
Great corporate that feature a new items and challenges!
YourCORP v1.11
Build your very own corporation!
Trade Item Extension v1.14
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.3
New weapons that have very unique abilities!
Click this link!

User avatar
AssumedPseudonym
Militia Captain
Militia Captain
Posts: 956
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Tue May 31, 2016 4:03 pm

 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

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 Commander
Militia Commander
Posts: 333
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Thu Jun 02, 2016 5:51 am

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!
Semesta I.G.C v1.34
Great corporate that feature a new items and challenges!
YourCORP v1.11
Build your very own corporation!
Trade Item Extension v1.14
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.3
New weapons that have very unique abilities!
Click this link!

Post Reply