Jump to content


Photo

Map Drops


  • Please log in to reply
47 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 26 May 2012 - 04:46 PM

Map Drops
Author: Tsukihime

hRoeD.jpg

Overview

This script allows you to discard items from your inventory and onto the map.
You can then pick it up later.

Features
  • Drop an item onto the map, either manually or using script calls
  • Dropped items can disappear overtime (decay time)
  • Customize decay times for individual items and equips
  • Dropped items are displayed using their icons
  • Add map drops using script calls
Usage

Go to your item menu and press the A key (game "X") to drop an item
Then see it on the map.

To add a map drop using script calls, use

add_map_drop('w23', amount)
add_map_drop('a12', amount)
add_map_drop('i1', amount)
Where the "w" means weapon, "a" means armor, and "i" means item.

You can specify a specific x,y position on some map.
By default, the position is your player's current position, and the map ID is the current map's ID.

add_map_drop(string, amount, x, y, map_id)

add_map_drop('a3', 1, 4, 5, 2) #create item in map 2 at position (4,5)
add_map_drop('i1', 2, 3, 3) #map_id is omitted
add_map_drop('w2', 1) # x, y, and map_id omitted)
If decay time is not 0, it will disappear after that many seconds.
You can choose whether dropped items will disappear or not.

To specify decay times for individual items or equips, tag them with
<drop-decay: n>
Some configuration options available:

Default_Disable - dropping items from inventory is disabled by default. Access this through $game_system.mapdrop_disabled through script calls if you need to change this throughout the game.

Enable_Maps - you can only drop items in certain maps
Enable_All - you can drop items on any map (overrides Enable_Maps options)

Download

Script: Download here

Notes

Does someone want to improve the script by providing a nice confirmation window as well as a number input when discarding?

Also, creating the chest opening animation is kind of tedious. Someone want to do that? It's basically printing out the page list for an existing chest event and then copying all of that in script.

Edited by Tsukihime, 31 October 2016 - 09:36 AM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#2 Shablo5

Shablo5

    Advanced Member

  • Ace Member
  • 161 posts
  • RM Skill - Designer

Posted 26 May 2012 - 05:36 PM

Will you combine this functionality with your Inventory mod?

#3 shaz

shaz

    Advanced Member

  • Ace Member
  • 611 posts
  • LocationAustralia
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 26 May 2012 - 05:36 PM

Nice idea, and it'd probably suit something I'm adding to my game, but was going to do via events.

Does the item hang around if you go to another map then come back again?

#4 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 26 May 2012 - 05:43 PM

Yes, drop items are currently stored in a global hash in Game_System for each map.
Though, they'll only disappear when they actually decay (if they ever decay). I should probably provide some methods to forcibly clear out all drops.

Will you combine this functionality with your Inventory mod?


Probably. If I ever get around to managing discards anyways.
Well, it already works for me lol cause I develop everything in one project.

Edited by Tsukihime, 26 May 2012 - 06:18 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#5 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 325 posts
  • LocationLakewood, Washington
  • RM Skill - Jack of All Trades

Posted 26 May 2012 - 06:39 PM

Is it possible to have events interact with the items, maybe have an event with <Thief> in the comments and as it wanders around it steals the items...or certain items. Maybe monsters are attracted to food items...

#6 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 26 May 2012 - 07:17 PM

Is a good idea, but I'm not sure how that would be implemented.

You would also have to program such a thief AI to move towards map drops. And then add logic to check whether the event is "taking" the item or not.

Maybe someone else will come up with something.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#7 Xigos The Xelor Sandglass

Xigos The Xelor Sandglass

    Advanced Member

  • Ace Member
  • 50 posts
  • RM Skill - Jack of All Trades

Posted 27 May 2012 - 03:36 PM

This would be interesting for an action battle system where the enemies will drop items on the ground upon death.
Sorta like in a MMO.
Spoiler


#8 D.S.Sirius

D.S.Sirius

    Advanced Member

  • Ace Member
  • 126 posts
  • LocationUK
  • RM Skill - Game Developer

Posted 27 May 2012 - 03:48 PM

Nicely done Tsukihime! I will certainly be using this.

I have perhaps happened upon a small bug. It appears transitions between maps will briefly show the two maps merged at the point of transtition while this script is active.

Do you suppose this script needs to be fairly high in the materials section?

This is a fantastic script other than that; well done indeed.

Edited by 8mike8, 27 May 2012 - 04:16 PM.


#9 spywaretof

spywaretof

    Advanced Member

  • Ace Member
  • 34 posts

Posted 28 May 2012 - 10:17 AM

Hey,

Tanks for this script !

I get an error when the inventory is empty and I pressed A.

123 line of the script.

Edited by spywaretof, 28 May 2012 - 10:18 AM.


#10 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 28 May 2012 - 10:56 AM

Fixed.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#11 spywaretof

spywaretof

    Advanced Member

  • Ace Member
  • 34 posts

Posted 28 May 2012 - 01:18 PM

Thank you for the correction of the script.

Now I use in my game script Awesome Light Effects 1.0 Khas and when the object appears on my card and when I take the object on the screen is darkened I think the problem come from the script call ...

Like this:

s = $ game_map.effect_surface
s.change_color (600,0,0,0,100)

Thank you again.

#12 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 28 May 2012 - 02:12 PM

Can you post a copy of the script in pastebin or something I don't want to download the entire demo.

Edited by Tsukihime, 28 May 2012 - 02:12 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#13 D.S.Sirius

D.S.Sirius

    Advanced Member

  • Ace Member
  • 126 posts
  • LocationUK
  • RM Skill - Game Developer

Posted 28 May 2012 - 02:23 PM

Can you post a copy of the script in pastebin or something I don't want to download the entire demo.


That's also a script I use in my game. I would second the request for added compatabillity between the two scripts.

Here is the Light script as requested:

http://pastebin.com/s8z45kRb

I hope that'll do. I was not sure how to utilise paste bin. I've edited the code of this script slightly so that it fits a screen width of 640.

Edited by 8mike8, 28 May 2012 - 02:26 PM.


#14 spywaretof

spywaretof

    Advanced Member

  • Ace Member
  • 34 posts

Posted 28 May 2012 - 02:25 PM

yes here is the script
Spoiler


...

#15 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 28 May 2012 - 02:47 PM

I've updated the script.
I was refreshing the entire spriteset rather than just the characters.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#16 D.S.Sirius

D.S.Sirius

    Advanced Member

  • Ace Member
  • 126 posts
  • LocationUK
  • RM Skill - Game Developer

Posted 28 May 2012 - 03:24 PM

Splendid! Nice job Tsukihime.

p.s.

Just to confirm, I've ran a retest. You're most recent edit to the script has fixed the bug I reported also.

Edited by 8mike8, 28 May 2012 - 03:26 PM.


#17 spywaretof

spywaretof

    Advanced Member

  • Ace Member
  • 34 posts

Posted 28 May 2012 - 03:38 PM

thank you for correcting it works perfectly !

#18 Paddy

Paddy

    I am The Human Flamethrower. Woooo!

  • Ace Member
  • 371 posts
  • LocationCaerdydd, Cymru
  • RM Skill - Jack of All Trades

Posted 02 June 2012 - 02:12 PM

This may be a stupid question, but can this be made to work only on certain maps? So, if my character has his/her own armory, for example, they can only drop/collect items from there.

| MY SPRITES! cookiemonster.gifMY GFX! |

 

DeadpoolSig-Poe.jpg

 

Deadpoolgif-Poe.gif


#19 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 02 June 2012 - 02:42 PM

I've added configuration options.

To enable/disable dropping items from inventory, use script calls

$game_system.mapdrop_disabled = true/false

At the top of the script, add the map ID's that map drops should be allowed in the Enable_Maps list.
If you want to enable map drops for all maps, you can ignore the list and just set Enable_All to true.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#20 Paddy

Paddy

    I am The Human Flamethrower. Woooo!

  • Ace Member
  • 371 posts
  • LocationCaerdydd, Cymru
  • RM Skill - Jack of All Trades

Posted 02 June 2012 - 03:18 PM

Fantastic! Thanks very much, man. :)

| MY SPRITES! cookiemonster.gifMY GFX! |

 

DeadpoolSig-Poe.jpg

 

Deadpoolgif-Poe.gif





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users