Jump to content


Photo

[SGEN] Script-Generated Edifice aNomaly: Core v1.1

rgss2

  • Please log in to reply
10 replies to this topic

#1 ???nOBodY???

???nOBodY???

    moogles + nightmares + coffee = Scripting Psychopathic Tendency

  • Ace Member
  • 109 posts
  • Location???nOWheRE???
  • RM Skill - Coder

Posted 20 November 2014 - 03:33 PM

[SGEN] Script-Generated Edifice aNomaly: Core

 

by ???nOBodY???

Introduction
# This script aims to extend the default engine's control over just about all things tileset & autotile, in general,
# by giving a designer some nifty tools to do so. Want your fence to use a different autotile as a ground layer?
# Covered. Want to change your tileset on the fly, using a simple script call, with its only argument being an id
# pointing to a customizable hash? Covered. Want to change all water tiles to lava on-the-fly? No problem.
# Want a complex animation involving the map's tiles directly? Why yes, yes you can use TileE and all of its
# tiles in sequence for a parallel processing event. The possibilities are endless; it all starts with you.

Features
# -Tile Swapping (by x,y)
# -Tile Swapping (by tile id)
# -Autotile Configuration
# -Tileset Configuration (/w extra tileset functionality)
# -Tileset Swapping
# -Extra Map Layers

Script
Please grab the demo:
build_v1.0

build_v1.1

 

*bugfix (thanks Ixfuru)

*  event images set to the tileset will properly update with tileset changes

Spoiler


Author's Note
# *if you use this script, you must give credits to the following:
# -Aindra, from rpgmakervx.net, for Tile ID Information and References
# -PK8, from rpgmakerweb.com & save-point.org, for implementation of extra layers
# -Tsukihime, from rpgmakervxace.net, for the original idea of "tile swapping"
# -KilloZapit, from rpgmakervxace.net, for autotile generation code
# -ShadowD, from rpgmakervx.net, for the technical inspiration way back when
# -???nOBodY???, from both rpgmakervx.net & rpgmakervxace.net
#
# *It's free for noncommercial & commercial useage, but if it's for a commercial project,
# only if all credits are given, and if you contact me first.
# *This script is VX.net-exclusive; if you want to share it, either link to it, or contact me via PM.
#
# I've nothing further to say, other than enjoy, and leave any questions, comments, concerns, or
# suggestions by posting below.  ;)  


Edited by ???nOBodY???, 13 January 2017 - 11:12 PM.

=========================================
#Every Moogle's Worst Nightmare; plus ramen#
=========================================
My Scripts:

=========================================


#2 ixfuru

ixfuru

    Member

  • Ace Member
  • 11 posts

Posted 09 December 2014 - 11:31 AM

You know I still love this script, ???nOBodY???!

 



#3 ixfuru

ixfuru

    Member

  • Ace Member
  • 11 posts

Posted 25 July 2016 - 04:44 AM

Hey ???NoBoDy??? I'm not sure you even still check this thing.  But if you do, I would like to inform you of a few things I've found regarding this script.

First off, I need to tell you up front that I modified the script to do as I needed it for Netherquest. The game offers fast travel to certain points in the game.  As such, I couldn't always do a 'hard script call' from an event that altered the tilesets when entering through a door or other transfer to a new map.  So I added a TransferTilesets Hash which works alongside your script which checks at all transfers for the tileset_id linked to the new map's ID. 

Anyway, a while back I got this script called 'Mithran's Prevent Sprite Crash' because the game was crashing in wierd ways.  The script is handy, and I was able to pinpoint some spots in the new scenes I created which were leaving sprites or viewports un-disposed.  That said, there is still a viewport or something from your script which isn't being disposed of properly.  It doesn't crash, but it does send a text of the error found when it occurs.  I'll try and get it to happen again, and when it does, I'll try and post the text output here so you can see it. 

Secondly, and more crucial probably, is a glitch I found when an event's graphic uses one of the tileset images.  You know how you can create events and choose from Tile B through Tile E when selecting a graphic?  Well, when using this script, even when the tileset is changed, when you use a graphic like this, it always shows the default Tile B through Tile E graphic instead.  I know this because I had an orange tree that I made the top of as an event to overlap some stuff.  The result was an orange tree with a green top.

That is all good sir.  Hope you get this and are able to fix at least the second issue.



#4 ???nOBodY???

???nOBodY???

    moogles + nightmares + coffee = Scripting Psychopathic Tendency

  • Ace Member
  • 109 posts
  • Location???nOWheRE???
  • RM Skill - Coder

Posted 18 December 2016 - 12:15 AM

Moshi moshi kikoemasuka? I check these rather infrequently, but check them infrequently I still do.

So basically, event graphics aren't reflecting changes made to the map?

 

The first issue might not be something I can fix. It's been awhile since I wrote this, and I'm not sure

how Netherquest's scripts affect this. I could, of course, still take a looksie.

 

That is, if the furu's haven't forgotten or fixed this, finally.


=========================================
#Every Moogle's Worst Nightmare; plus ramen#
=========================================
My Scripts:

=========================================


#5 ixfuru

ixfuru

    Member

  • Ace Member
  • 11 posts

Posted 20 December 2016 - 11:20 AM

I've been unable to fix the first issue. It's the way the tileset disposes upon a fast travel. I'm on my phone, but i'll try to explain the tileset transfer hash i made through code:

Map_id => tileset-id

Every map in the game links to one of the tilesets in your script's tileset hash. I'll have to edit this when i get home and copy paste the actual perform transfer method so you can see how your script is called.

For the second issue, i still havent figured out why that occurs either. Having made this script, I'm positive you know more about tilesets than I do. There just needs to be a way to ensure the event sprite matches the tile from the set in use from your script if you use a tileset image as the event's graphic.


****EDIT*****

Okay.  Here's the perform transfer method:

 

#--------------------------------------------------------------------------
  # * Execute Player Transfer (Aliased)
  #--------------------------------------------------------------------------
  alias nqperform_transfer perform_transfer unless $@
  def perform_transfer
    if $game_switches[80]
      if !Ixfuru::NqOcc::TRANSPLACEMENT_MAPS.include?(@new_map_id)
        @transferring = false
        $nq_system.fasttext.string.push("Cannot transfer during Transplacement")
        $nq_system.fasttext_counter = 180
        $nq_system.fasttext_showing = true
        return
      end
    end
    tts = Ixfuru::TransferTilesets::TILESETS
    return if !tts.has_key?(@new_map_id)
    tileset_id = tts[@new_map_id]
    if $game_system.tilesetID != tileset_id
      $game_map.interpreter.qwerty_change_tileset(tileset_id)
    end
    nqperform_transfer
  end

You can see in the second part of the transfer, before it calls the aliased original method, it looks up the appropriate tileset from the hash (tts).  Then, it sets the local variable tileset_id equal to the appropriate hash entry.  Finally, if the tileset_id isn't equal to the tilesetID from your script, it changes it to make it so.

Here is one such output from Mithrans script.   Remember that Mithran's script only sends this output if there is an undisposed sprite or viewport:

 

Spoiler

Edited by ixfuru, 21 December 2016 - 03:49 AM.


#6 ???nOBodY???

???nOBodY???

    moogles + nightmares + coffee = Scripting Psychopathic Tendency

  • Ace Member
  • 109 posts
  • Location???nOWheRE???
  • RM Skill - Coder

Posted 23 December 2016 - 03:32 PM

I'll take a closer look at this when I get home, as I too, am on my phone. It looks like something in mine isn't playing nice with this 'Nq_Player' script. I don't suppose I could trouble you to either mssg me with that script in its entirety, or your project itself? Anyway, I'll try to look at this over Christmas. ;>

=========================================
#Every Moogle's Worst Nightmare; plus ramen#
=========================================
My Scripts:

=========================================


#7 ixfuru

ixfuru

    Member

  • Ace Member
  • 11 posts

Posted 24 December 2016 - 06:44 PM

<LINK REMOVED!>
 

Be sure to notify me on here when you get it, so I can remove the link.  This is the unencrypted version.
 

This is the link to the NetherQuest Project, so you can see what's going on with it.  Remember to look at Mithran's script because it outputs the info regarding undisposed sprites and viewports. If you want to make the error occur, and get Mithran's script to output the information, load up save9, the one with 70+ hours, go into the Atlas scene from the menu and teleport to 'Clark', 'Turline', or 'Koza'.  This use of teleportation is the only time it occurs.

For the other issue, you can just make add an event to one of the newer maps and use the a Tile image as its event graphic.  You will see that during runtime, the event will use the tile image from the default set regardless of which tileset in your script is active.

The maps are linked to the tileset_IDs through the module 'TransferTilesets'.

 

************EDIT*****************

Hey, if you're gonna play through the demo, you'll need to fix this method in the Nq_Journal script:

 

#-----------------------------------------------------------------------------
  # Entry has Topic?
  #-----------------------------------------------------------------------------
  def entry_has_topic?(teller, topic)
    return false unless @entries.has_key?(teller)
    for i in @entries[teller]
      next unless i[1] == topic
      return true
    end
    return false
  end

Again, this isn't mandatory to fix the issues we've discussed, but it will cause an error if you're trying to play through.  Working on simplifying the dialogue system.


Edited by ixfuru, 26 December 2016 - 10:44 AM.


#8 ???nOBodY???

???nOBodY???

    moogles + nightmares + coffee = Scripting Psychopathic Tendency

  • Ace Member
  • 109 posts
  • Location???nOWheRE???
  • RM Skill - Coder

Posted 26 December 2016 - 09:19 AM

You can go ahead and remove the link whenever.

=========================================
#Every Moogle's Worst Nightmare; plus ramen#
=========================================
My Scripts:

=========================================


#9 ???nOBodY???

???nOBodY???

    moogles + nightmares + coffee = Scripting Psychopathic Tendency

  • Ace Member
  • 109 posts
  • Location???nOWheRE???
  • RM Skill - Coder

Posted 09 January 2017 - 01:27 PM

So here's the deal; I don't actually have a working computer at the moment, but hopefully the battery I ordered for my laptop fixes this. Hence, such a late reply.

=========================================
#Every Moogle's Worst Nightmare; plus ramen#
=========================================
My Scripts:

=========================================


#10 ixfuru

ixfuru

    Member

  • Ace Member
  • 11 posts

Posted 11 January 2017 - 03:52 AM

Hey man. 

I fixed the one issue with the Event sprite not reading from the correct Tileset.  Here's the code. 

 

################################################################################
#                          SGEN Fix
#                         By: Ixfuru
#                    A patch to a script by:
#                        ???nObOdY???
#                       January 11, 2017
################################################################################
class Sprite_Character
  
  #--------------------------------------------------------------------------
  # * Get tile set image that includes the designated tile
  #     tile_id : Tile ID
  #--------------------------------------------------------------------------
  alias ixsgenfix_tlsetbmp tileset_bitmap unless $@
  def tileset_bitmap(tile_id)
    if $game_system.tilesetID > 0
      set_number = tile_id / 256
      tilesets = EXTRA_TILESETS
      set = tilesets[$game_system.tilesetID]
      bset = set[5]
      cset = set[6]
      dset = set[7]
      eset = set[8]
      return Cache.system(bset) if set_number == 0
      return Cache.system(cset) if set_number == 1
      return Cache.system(dset) if set_number == 2
      return Cache.system(eset) if set_number == 3
      return nil
    else
      ixsgenfix_tlsetbmp(tile_id)
    end
  end
  
end

I guess I should have looked into fixing that one myself sooner, rather than bothering you with it.  I'm not sure I can fix the other issue, but I'm also not sure that's your issue, as I've added so much to the project.



#11 ???nOBodY???

???nOBodY???

    moogles + nightmares + coffee = Scripting Psychopathic Tendency

  • Ace Member
  • 109 posts
  • Location???nOWheRE???
  • RM Skill - Coder

Posted 13 January 2017 - 11:15 PM

Updated the op; thanks dood.

As for my pc issue; dug out my old machine, and looks like it still works well enough.

I'll let you know if I find anything with your other issue, but uh... I'll need a PMed link to your project again. >.<

My paperweight pc had the technologies. All of them.


Edited by ???nOBodY???, 13 January 2017 - 11:18 PM.

=========================================
#Every Moogle's Worst Nightmare; plus ramen#
=========================================
My Scripts:

=========================================






Also tagged with one or more of these keywords: rgss2

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users