Author Topic: [XP] Grid-Free Doodads  (Read 1583 times)

Offline Wecoc

  • Transcended Spirit
  • ***
  • Posts: 108
  • LV: 44
  • Gender: Male
    • View Profile
    • Mundo Maker
[XP] Grid-Free Doodads
« on: January 28, 2017, 10:47:09 PM »
Grid-Free Doodads
Authors: Wecoc
Version: 1.01
Type: Doodad System
Key Term: Game Utility

Introduction

Grid-Free Doodads is a system that implements on your game the use of Doodads, in other words, tiles which are not fixed on the default editor grid.

With this you can get an effect very similar to those made with parallax mapping but this time controlled on the game, with extra options. Also, the size of the game file will be much lower, solving this way the main problem found on games that use parallax.

This system was inspired by the Grid-Free Doodads plugin for RPG maker MV, made by Yanfly.
It contains a total of 7 scripts: Mouse and Keyboard support, a script containing all the info you need to know to use this system in your game, and the system by itself divided in 4 parts.

Features

  • Unlimited Doodads per map
  • You can see the Doodads on the project as normal tiles (not on the Editor)
  • Area Support to use Regions like in VX/Ace/MV --> No passable Doodads
  • Animated Doodads with unlimited frames, yay!
  • Doodads which appear under a condition

Screenshots

(click to show/hide)

Demo

Grid-Free Doodads 1.01 (English)
Grid-Free Doodads 1.01 (EspaƱol)

Script

You will find the 7 scripts in the demo, place them in your game (first you should save a copy of you game on its current state). Place them over main and over other custom scripts. You will find more detailed Instalation info inside the script Doodad Info.

Instructions

Inside the script Doodad Info

(click to show/hide)

Compatibility

If you are using other Mouse and Key support scripts in your game you can use them instead of the ones found in the demo, but you will have to edit the last script (Doodad Setup) to adapt it to your scripts.

You will probably get an error if you try to load a save file of your game, if you saved it before inserting Grid-Free Doodads.

No other compatibility issues were found.


Credits and Thanks

  • Wecoc - Grid-Free Doodads
  • Glitchfinder - Key Input & Mouse

Author's Notes

This is for rebels who still use RPG maker XP but want Doodads because f*ck, they are great.
Enjoy~
« Last Edit: January 30, 2017, 07:00:38 PM by Wecoc »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3043
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Grid-Free Doodads
« Reply #1 on: January 28, 2017, 11:09:41 PM »
(click to show/hide)
I remember seeing the MV script on Youtube and was like "Damn we need that shit in XP--I should make it once I finish my other things".
But dude you have delivered.
++ bro



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19930
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Grid-Free Doodads
« Reply #2 on: January 29, 2017, 10:31:59 AM »
This is awesome! How did you implement them in the backend? With tiles or events?
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Wecoc

  • Transcended Spirit
  • ***
  • Posts: 108
  • LV: 44
  • Gender: Male
    • View Profile
    • Mundo Maker
Re: [XP] Grid-Free Doodads
« Reply #3 on: January 29, 2017, 09:02:33 PM »
How did you implement them in the backend? With tiles or events?

I thought events would probably increase lag much more, so I created an entire new type.

The Doodads are default RPG::Sprite stored on Spriteset_Map, but their properties are defined using a new class "Doodad", and saved to Doodads.rxdata, which is created the first time you insert a doodad.
The Area info is saved in Map(ID).rxdata in a very easier way as many other default properties of the map; my first plan was doing the same with all the doodads data but I had some troubles with that so I decided to store all their info in a new rxdata.

Some project compilators still work anyway, some others will need some changes to compile Doodad.rxdata with the others.

Also, talking about lag, I tested it adding 200 animated doodads in the map and lag is nearly the same as you can see here.
(click to show/hide)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19930
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Grid-Free Doodads
« Reply #4 on: January 29, 2017, 09:39:54 PM »
Nice. It was a good idea to make it a separate file so maps can be still easily edited in RMXP's editor.

(click to show/hide)
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3043
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Grid-Free Doodads
« Reply #5 on: January 30, 2017, 06:14:07 AM »
Things I noticed in the demo:
  • When placing Areas, if you scroll around the map, it sometimes would not be in the position of the mouse cursor.
    (click to show/hide)
  • Why is it that if I place Areas, change the map size, then check the placed Areas again, Areas that I newly place are gone but the ones you pre-defined that came in the demo are still there?
  • While placing a doodad, if you edit it, but press Input::B, it takes you back to the main menu and places the doodad you currently had selected (should function like I pressed 'Finished Edition' (by the way, the correct word is "Editing")
  • Window cursor index should be reset to zero. For example, if you edit a doodad, go all the way to the bottom ("Condition"), press Input::B, then Edit Doodads again, you get this:
    (click to show/hide)
  • You should handle invalid syntax when making Conditions. In Window_DoodadEdit#refresh:
Code: [Select]
        result =
        begin
          eval(@doodad.condition)
        rescue SyntaxError
          print $!
          nil
        rescue
          print $!
          nil
        end
    This will print the error they made in their code, while not just crashing the user entirely of all their progress.
    You'll also need to do the same to Spriteset_Map#update, but remove the print statements (or you will forever spam the user with messages).
« Last Edit: January 30, 2017, 07:30:31 AM by KK20 »



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Wecoc

  • Transcended Spirit
  • ***
  • Posts: 108
  • LV: 44
  • Gender: Male
    • View Profile
    • Mundo Maker
Re: [XP] Grid-Free Doodads
« Reply #6 on: January 30, 2017, 07:06:20 PM »
Thank you KK20 for testing it all.

Fortunately, many of these bugs were easy to fix, I already fixed them and upload the demo(s) again.
But there's one I don't know how to fix or if it's even possible...

Quote
When placing Areas, if you scroll around the map, it sometimes would not be in the position of the mouse cursor.
I knew using Mouse.tile_x and Mouse.tile_y for that would not be a good idea after all. I believe I fixed it, now it's done with Mouse.x and Mouse.y

Quote
Why is it that if I place Areas, change the map size, then check the placed Areas again, Areas that I newly place are gone but the ones you pre-defined that came in the demo are still there?
I see what happens, you have to quit the program and restart it after defining new Areas so they will not be erased when changing the map properties on the editor after that.
I have no idea how to fix this.

Quote
While placing a doodad, if you edit it, but press Input::B, it takes you back to the main menu and places the doodad you currently had selected (should function like I pressed 'Finished Edition' (by the way, the correct word is "Editing")
Ok silly mistake (and silly misspell, lol). Fixed.

Quote
Window cursor index should be reset to zero. For example, if you edit a doodad, go all the way to the bottom ("Condition"), press Input::B, then Edit Doodads again, you get this
Fixed on the Edit window, I don't know if the same problem is anywhere else. I've been trying some combinations and everything seems fine.

Quote
You should handle invalid syntax when making Conditions.
Good point. Done!

I also fixed another bug I found; hue changes were not working properly on animated doodads.

If somebody finds other bugs please let me know.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3043
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Grid-Free Doodads
« Reply #7 on: January 30, 2017, 08:55:22 PM »
Quote
I see what happens, you have to quit the program and restart it after defining new Areas so they will not be erased when changing the map properties on the editor after that.
Can't you just do the same thing as you did with Doodads.rxdata and make an Areas.rxdata?



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Grid-Free Doodads
« Reply #8 on: February 02, 2017, 09:33:38 AM »
Just want to point out

Code: [Select]
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup(map_id)
    doodads_setup(map_id)
    if FileTest.exist?("Data/Doodads.rxdata")
      doodads = load_data("Data/Doodads.rxdata")
      @doodads = doodads.select{|doodad| doodad.map_id == map_id}
    else
      @doodads = []
    end
  end

FileTest.exist? won't detect items inside encrypted project
try this instead : RPG_FileTest.exist?