Help with item coding

A place to show off your mods and discuss modding Barotrauma.
WarlordToby
Dr. Bright's Assistant
Posts: 30
Joined: Thu Jun 16, 2016 1:51 pm

Help with item coding

Postby WarlordToby » Thu Jun 16, 2016 5:37 pm

So, i basically did create something, made a sprite for it with Gimp and there are no warnings in code.
Problem is; The game does not seem to load the item i did.

Funny...

User avatar
juanjpro
Barotrauma Developer
Posts: 1177
Joined: Sun Dec 16, 2012 10:51 pm
Location: NaN

Re: Help with item coding

Postby juanjpro » Thu Jun 16, 2016 5:40 pm

The game does not search for any new files it may be able to load. Instead it needs a reference given in the selected content package in Data/ContentPackages.
Currently working on PulseGun and Barotrauma.

WarlordToby
Dr. Bright's Assistant
Posts: 30
Joined: Thu Jun 16, 2016 1:51 pm

Re: Help with item coding

Postby WarlordToby » Thu Jun 16, 2016 5:51 pm

I managed to figure it out.
Also i assume the sprite source is x y, x y type?

User avatar
Regalis
Undertow Games Founder
Posts: 438
Joined: Fri Nov 02, 2012 11:28 am
Location: Finland

Re: Help with item coding

Postby Regalis » Fri Jun 17, 2016 2:16 pm

WarlordToby wrote:I managed to figure it out.
Also i assume the sprite source is x y, x y type?


If you mean the sourcerect parameter, it's "x, y, width, height".

WarlordToby
Dr. Bright's Assistant
Posts: 30
Joined: Thu Jun 16, 2016 1:51 pm

Re: Help with item coding

Postby WarlordToby » Sun Jun 19, 2016 10:28 am

Thank you, that really left me thinking but thank you!

DarkPaapi
Class-D
Posts: 5
Joined: Thu Feb 23, 2017 10:04 pm

Re: Help with item coding

Postby DarkPaapi » Fri Feb 24, 2017 5:52 pm

Hello guys.

Is it possible to set a contained item active if the parent item is "OnUse" or "OnActive", just asking because I made a gun and want an option to put a flashlight into the itemcontain slot and become active when I'm using the main item.

etet2
Technician
Posts: 97
Joined: Fri Jan 29, 2016 8:00 pm

Re: Help with item coding

Postby etet2 » Sun Mar 19, 2017 12:33 pm

DarkPaapi wrote:Hello guys.

Is it possible to set a contained item active if the parent item is "OnUse" or "OnActive", just asking because I made a gun and want an option to put a flashlight into the itemcontain slot and become active when I'm using the main item.

that's impossible to do right now. you could make it possible to make gun with flashlight in fabricator

DarkPaapi
Class-D
Posts: 5
Joined: Thu Feb 23, 2017 10:04 pm

Re: Help with item coding

Postby DarkPaapi » Tue Mar 21, 2017 3:56 pm

etet2 wrote:that's impossible to do right now. you could make it possible to make gun with flashlight in fabricator


Thanks. Than i need to go with the Plan B. If a flashight is equipted on the guns inventory slot its turning on a light cone, just like the normal flashlight when is equipted.


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest