Item Containers [Complete]

Started by Mightylink, April 29, 2009, 03:03:25 am

Previous topic - Next topic

Mightylink

April 29, 2009, 03:03:25 am Last Edit: May 01, 2009, 08:29:50 pm by Mightylink
Its been a wile since I requested a script :P I feel I've improved over time and able to create things on my own, but now I could use some help.

I been trying to do this with events and felt like I was getting close but I think its missing the nessiccary commands to get this working so I am requesting a script I hope someone will create, not just for me but for everyone to enjoy.

The concept is simple, be able to not only take items but put items into a chest as well. Normally this can easily be done by add item event, but taking items I couldnt figure out. Even with variables saving items, theres no process to take items from the player, not unless you want a million choice long list with millions of if statements for every item in the game, so I figure a script will be much easier.

The idea is to get a chest to take your items as well and keep them there until you are ready to take them out again. This is the same system from Oblivion and Knights of the Old Republic 2.

Anyone up to the challenge?

G_G

I'll give it a go as if you want me to. Sorry about your computer I didnt know it would give you a virus I'm really sorry but I can try doing this to make up for it. Sorry  :'(

Mightylink

April 30, 2009, 10:35:04 pm #2 Last Edit: April 30, 2009, 10:37:17 pm by Mightylink
It's not your fault, I been reading a lot about it and apperently its a brand new virus spreading very fast, it came through the popups at sothink and its near impossible to get rid of, or at least nobodys figured out how yet. No antivirus or spyware program will fix it cause it migrates around the windows folder. As far as I can tell it doesnt cause any damage and it doesnt send any info to anywhere so I am safe for the moment, although I cant use google anymore...

You don't have to do this for me but I would like to see someone try, I suck at scripting, im only now begining to learn basic menus. You dont have to do it for me, but if you want to do it for everyone, this would be a hot script to have in CP if it works :P

You know what I think would work is a new shop window that doesnt use money so it buys and sells everything free but it remembers what you sold and puts it in the buy list. Again I tried this with events but the shop processing doesnt let you get items from variables, let alone tracking them <_<

legacyblade

Hey, I've been thinking of requesting a script like this too. (I tried making it, but with no luck so far) Maybe you could also make an addon for it when you're finished, to treat the corpses from blizzABS like a container (so it'll be like the oblivion/morrowind series). If you do make the addon (just a suggestion), you should put a "dispose of corpse" button to prevent lag.

G_G

April 30, 2009, 11:13:27 pm #4 Last Edit: April 30, 2009, 11:27:26 pm by Youngster Gi Gi
I started on it and its done except this darn error I'm getting but I'll get it done I promise :D


I FIXED THE ERROR! Its done it was really easy took 20 minutes.

Let me setup a demo.

Mightylink


G_G

I'm still going to add somethign to it. Where you select how many items you want to put in there but for now you can only do one item at a time instead of puttin 50 potions in there at a time.

http://www.sendspace.com/file/ig1iz1 DEMO

I feel a bit better bout what I did :( hopefully its what you wanted :/

Mightylink

Awesome work dude, still some bugs to work out before its useable, I crashed when I tried to use it, heres my situation.

I put items in, saved my game and quit.

Loaded my save file, clicked on the box and it gave an error:



Other then that this works very nicely, runs smooth, the window layout is great, just needs to stop crashing lol. I hope you will post this in the script section when your done, you deserve the credit :)

And once the error is fixed I would be more then happy to use it.

G_G

May 01, 2009, 12:21:19 am #8 Last Edit: May 01, 2009, 12:22:57 am by Youngster Gi Gi
Yea i forgot it to save the chest crap. Here use this

http://www.sendspace.com/file/44bhdc

Tested and working. It works perfectly now.

Mightylink

Awesome man, you did a great job. Just wondering though, can you support multiple chests, maby do this through a variable, I was hoping to use this for every container in the game but if you dont feel like it thats cool, I will use this for the chest at home.

G_G

I got an idea on how to do that. Will do. But instead you'll have to use this

$scene = Scene_Chest.new(variable_id)


I'll get it done after school.

Mightylink

May 01, 2009, 02:19:06 pm #11 Last Edit: May 01, 2009, 02:33:45 pm by Mightylink
Sounds good, and there is 1 more minor error, the item description is cut off behind the menu at the top right, You should remove the description completly or move it down to a new line in order for it to show up :P

You did a good job, a lot of people will be proud.

Just wondering, is there a way to have items in the chest by default?

G_G

I'll fix the description. It is now possible to have seperate chests and closets etc.
I'll fix up a new demo.

In the demo talk to the chick get some items, store two in one chest then go to the other and notice how there are none in the other one but the others are still in the first chest.

To call the chest use
$scene = Scene_Chest.new(variable_id_here)


The chest items are stored in variables I'm working on it to make it possible without wasting variables.

Be sure to not change variables you use for closets, pawn shops, whatever or else the script wont work. Sorry for having six different scripts but I dont like all my coding bunched up together unless I release it for the Database which I might if its ok with you. And these scripts that are in here are just default scripts cut up and fused together so sorry bout that too.

And again sorry about your computer :( I wish I could only help more

New Demo Now With Seperate Chests

Mightylink

Stop saying that, its not your fault nor do i blame you. You did a terrific job and the last thing I would like to see now is have chest with items already in it, idk the easiest way to go about this, maby a config section in the script that assigns items to different values in the chests variable, you just need to make sure the items dont reappear when they are taken :P

G_G

May 01, 2009, 05:57:54 pm #14 Last Edit: May 01, 2009, 06:03:05 pm by Youngster Gi Gi
Items dont reappear when you take them do they?

Well I'll try getting the default items in a chest.


Ok heres how to add items to the chest already. I already knew how to do this but when I made the script be able to work on seperate chests it became a problem.

First ok say you're first chest at Home has teh variable id of 43 use this script call command
$game_variables[43] = $chest


This needs to be executed before an actual chest is open. Then to open the chest of course use
$scene = Scene_Chest.new(43)

Then to add an item use
$game_variables[43].gain_item(item_id, amount)


Hope that helped.

Mightylink

Awesome, I will test it out right now, good work. Your a really smart scripter, no ones ever taken my requests this seriously before :P

G_G

It should work I tested it. Any other suggestions? And do you care if this script is publically released? Of course it'll only be on CP.

Mightylink

May 01, 2009, 06:42:15 pm #17 Last Edit: May 01, 2009, 06:52:35 pm by Mightylink
Thats what I was hoping, this should be shared with everyone and I hope you get full credit for it :)

Oh one more tiny suggestion to make it perfect, pressing left or right switches between the 2 windows, that would speed up looting a bit.

G_G

I'll release it then. And did those script calls work?

Mightylink

May 01, 2009, 07:11:19 pm #19 Last Edit: May 01, 2009, 07:16:44 pm by Elite Four Starrodkirby86
ughh im sorry, i couldnt get chests with items already in it to work, here is my error and event

Spoiler: ShowHide


1 is health potions and 2 is magic potions, did I do something wrong? was I sappose to edit the scripts cause i didnt see a place to define variables in it.