Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Interactive World Map Script V1.1(Test V1.2 Now!)

Status
Not open for further replies.
Take your time with the script :) there is no rush. If I think of any other things you could add as an improvement I will definitely let you know. I am glad to help even if I have absolutely no scripting knowledge lol. However I would like to know how I can open the map using an item called the world map because I tried using the command
$scene = Scene_World_Map.new\
("World Map.bmp")
in a common event and having the item work but nothing happened I am curious if this is because I did something wrong or if your script somehow doesn't allow this feature. I am using the XAS ABS if that matters at all. If you know why the world map won't open please tell me I would be VERY THANKFUL.
 
Thanks Plague I got the script working in my game and I tested out the keyboard cursor method (#2) and I did not like how I had to repeatedly tap the direction buttons to move the cursor so another suggestion I have to improve this script would be to make it where you can hold a direction and it keeps on moving smoothly. That way by the time your cursor gets where you want it your fingers aren't falling off lol. Definitely looking foward to your next release and Happy Independance Day!
 
that is in new version, still working on the smooth method, but its better then old way :) its kinda ironic, i figured no one would use #2 i wasnt even going to include it at first(cause i made the mouse work) but i kept it cause i allready had the code.
 
ok so just so you guys dont think im not working on it here is my progress. fixed a fair number of minor errors. working on getting cursor type to 2 to look smoother. but those aren't that important, i wanted you guys to know i got a save file from the editor to successfully load in the normal script. so soon you guys will have that :) i think i will have it done some time in the next week or two(im back in bahrain and have to work :( )
 
ok blue i got rid of constants finally lol i was hoping you would tell me what you think about how i did it though.
[rgss]class Map_Settings
  # All icons are to be located in your Graphics/Icon folder.
  # All maps are to be located in your Graphics/Pictures folder.
  # All Sub section maps must be named after the town that it is a subsection
  # of. E.g. if the main town is called: "Saar" then the map name must be:
  # "Saar.bmp"
 
  # Icon used for the players current location
  @player_icon = "player"
  # Icon used for the cursor
  @cursor = "cursor"
  # Sound effect on move
  @move_se = RPG::AudioFile.new("018-Teleport01", 80)
  # Cursor offset type:
  # 1 = Static Choices(cursor can only go where the player can move)
  # 2 = Free Choice(cursor can freely move, like a mouse)
  # 3 = Mouse(do i really need to exsplain?)
  @cursor_type = 3
  # Only for CURSOR_TYPE 2
  # Number of pixels to move per left(down) or right(up) press
  @move_pixel = 15
  # Only for CURSOR_TYPE 2
  # Number of pixels around the icon you can click
  @pixel_offset = 20
  # Name Styles:
  # 1 = Under the cursor
  # 2 = Help window on top of screen
  # 3 = None
  @name_style = 2
  # Only for type NAME_STYLE 2
  # Opacity of Name Window
  @name_window_opacity = 235
  # Show player icon above town?
  @show_player = true
  # Number of the text color you want to use
  # Please note that you only need Window_Base(216 Colors) if you want to use a
  # non-default color(or use any other message script u want)
  @town_text_color = 211
  # Turn fog on and off
  @fog_on = true
  # Graphic used for fog, must be in the Graphics/Fogs Folder
  @fog_graphic = "001-Fog01"
  # Fog Opacity
  @fog_opacity = 64
  # Fog scroll X
  @fog_sx = 1
  # Fog Scroll Y
  @fog_sy = 1
  # Fog Blending Type(1=Normal, 2=Add, 3=Subtract)
  @fog_blend_type = 1
  # Editor Mode
  @editor_mode = false
#-------------------------------end config-------------------------------------
  # to save time commenting ill exsplain how all the methods work, if you type
  # Map_Settings.any_method() with no arguments it will return the current
  # value of that setting. but if you pass and argument such as:
  # Map_Settings.any_method("something") that will set the current value
  # to your new value.
  def self.player_icon(icon=nil)
    if icon == nil then return @player_icon end
    @player_icon = icon
  end  
  def self.cursor(icon=nil)
    if icon == nil then return @cursor end
    @cursor = icon
  end
  def self.move_se(icon=nil)
    if icon == nil then return @move_se end
    @move_se = icon
  end  
  def self.cursor_type(type=nil)
    if type == nil then return @cursor_type end
    if type > 3
      print("Not a valid type")
      type = @cursor_type
    end
    @cursor_type = type
  end
  def self.move_pixel(num=nil)
    if num == nil then return @move_pixel end
    @move_pixel = num
  end  
  def self.pixel_offset(num=nil)
    if num == nil then return @pixel_offset end
    @pixel_offset = num
  end
  def self.name_style(style=nil)
    if style == nil then return @name_style end
    if style > 2
      print("Not a valid style")
      style = @name_style
    end
    @name_style = style
  end
  def self.name_window_opacity(num=nil)
    if num == nil then return @name_window_opacity end
    @name_window_opacity = num
  end
  def self.show_player(bool=nil)
    if bool == nil then return @show_player end
    @show_player = bool
  end
  def self.town_text_color(num=nil)
    if num == nil then return @town_text_color end
    @town_text_color = num
  end
  def self.fog_on(bool=nil)
    if bool == nil then return @fog_on end
    @fog_on = bool
  end
  def self.fog_graphic(pic=nil)
    if pic == nil then return @fog_graphic end
    @fog_graphic = pic
  end
  def self.fog_opacity(num=nil)
    if num == nil then return @fog_opacity end
    @fog_opacity = num
  end
  def self.fog_sx(num=nil)
    if num == nil then return @fog_sx end
    @fog_sx = num
  end
  def self.fog_sy(num=nil)
    if num == nil then return @fog_sy end
    @fog_sy = num
  end
  def self.fog_blend_type(type=nil)
    if type == nil then return @fog_blend_type end
    if type > 3
      print("Not a valid type")
      type = @fog_blend_type
    end
    @fog_blend_type = type
  end
  def self.editor_mode(bool=nil)
    if bool == nil then return @editor_mode end
    @editor_mode = bool
  end
end  
[/rgss]
like i was wondering how you feel about these lines to be specific:
if icon == nil then return @player_icon end
I really like it cause i can call Map_Settings.player_icon to get it or Map_Settings.player_icon("dark") to set it
 
I gotta tell ya, my initial reaction after I looked at the code was less thrilling... to be exact, it was this (in a conversation with Glitchfinder, who pointed out that you'Re addressing a post to me):
BlueScope says (22:21):
...
>_<
dude
tell me he didn't do what he did
OMFG
>>>_<<<
So yeah, that's basically how we Germans say "Oh, I think someone missed the point in what I was telling them!" :) (either way, take no offense... apparently, it's been a misunderstanding, so no blame on you solely here)


So, let's get to the point... you did get rid of constants, alright, but well... you didn't exactly improve it all that much... my point was that constants are redundant because they're an additional definition that's unneeded, as people can customize within your script and don't need external definition bits. Meaning, instead of this:
[rgss]class Foo
  CONSTANT = "bar"
  def text
    return CONSTANT
  end
end
[/rgss]
you'd have this:
[rgss]class Foo
  def text
    return "bar"
  end
end
[/rgss]
As you can see, you're saving a definition line, as well as the effort to scroll up (obviously not in such a short script) or even switch between script entries to find out what the constant actually is. Most scripts manage to complicate a script for the reader instead of simplifying it.
Now, what you did is replace constants with instance variables - you got rid of constants for the sake of getting rid of them, without serving any purpose though... your solution is kind of the same as it was before, just using a different type of container (also, with this new one, you should've wrapped them in an initialize method ^^ )

Also, Glitch and I were puzzled wheather or not you realized that for a completely functional change, you'd need to release the other scripts as well. ^^


As for the line you asked me about, you could've spiced it up a bit, doing this:
Code:
return @player_icon if icon == nil
Other than that, it's a good idea IF it serves any purpose... is it possibly being called if the icon isn't the player icon? Because if so, the method name 'player_icon' is kinda wrong ^^

Glitch and I agree that you're working hard to make something cool out of this script, so please don't see this post as discouragement, on the contrary: You know I wanna help you ^^
 
its all good blue im completely self taught and im aware i am bond to make mistakes, and this is the third time ive completely rewritten the script cause what some one said i did something wrong lol but im still not discouraged(look at my original code if you want too see how far ive come: viewtopic.php?f=155&t=70432), im learning alot and i get a few downloads a day so i hope that means people are using it(tho ive added alot of features new version will be a thousand times better) anyways back to the point you want me to put it in a init, that makes sense. but as for changing the methods im still kinda choppy on what you really think i should be doing. im more then willing to do it tho. i want this script to be used by everyone :) i think the editor in next version will help(no scripting required to set up towns anymore)

p.s. i cant release the other scripts right now, making some major changes(thought of a way to massively improve editor, and still perfecting my saving and loading map data from files(works, but i think it could work better) im more then willing to send it to you to look at, but id rather the public not see how messy i am during production and coding lol(not that im good for post production lol)
 
I don't think I'm able to explain it any better than this:

BlueScope":2dbrm87k said:
Meaning, instead of this:
[rgss]class Foo
  CONSTANT = "bar"
  def text
    return CONSTANT
  end
end
[/rgss]
you'd have this:
[rgss]class Foo
  def text
    return "bar"
  end
end
[/rgss]

You're basically outsourcing values into variables (previously constants), while you could just put them in the respective spot (as in the lower code block up there)... but yeah, I said it all in the previous post, I really wouldn't know what to add now... ^^"

Also, I'm glad it's running well for ya. Like I said, it's noticeable you put work into this script, and I've redirected I think two people to this thread, so yeah... I think you'Re doing some folks something good here ^^
 
i see what your saying, i just dont see any of my code to change there is no constants, and i need @player_icon and such. i still have no idea....guess i shall take a look at the code more. but since it works, im going to focus on editor for now
 
Well, it's the same for variables really... just imagine the first code block to be this:

[rgss]class Foo
  def initialize
    @variable = "bar"
  end
  def text
    return @variable
  end
end
[/rgss]

In this block, there's no constants, but as @variable never changes, it could just as well be one. The thing is, both are unneeded, as it's just used once to get returned, aka you could just as well do what I did for the second code block in my last post and spare a container. Now of course, there are occasions where constants, and even more often instance variables make sense - for example, constants for keys in the various Input modules up there. Your variables such as @player_icon also make sense, as you change them along the way, so it makes sense. However, you still have stuff like @cursor = "cursor" (which is like the peak of uselessness... :/ ), which makes no sense whatsoever.
 
so the issue is i have some setting you feel will never be changed through out the game? if so that kinda makes sense, but how do you recommend i allow the user to set the initial value? or should i just set it up so the cursor is always called cursor and they have to name their file that?
 
You got what I mean now :) And well, the important part is to give them a way to use their own cursor. While therefore viable, it'd be a bad thing to force a certain filename onto them. The thing is, you're not doing that at all, as they still have the "cursor" string in the script - just not in some strange configaration part of it, but where it actually belongs. Personally, when I'd look for a place to change the cursor graphic file name, I would look in Mouse_Operations before Script_Configuration, but yeah... I honestly can't promise you that's what people will be doing, as this forum's been widely spoiled with the "constants way to do it"...

Really, you shouldn't try to help people necessarily that just throw all scripts in their projects mindlessly - those people will benefit from the customization scripts, as it's all neat and tidy and they have nothing else to do than being noobs. Instead, reward the people that look at a script, see it's uses, customize it to their needs and therefore are happy if they find anything they need within that very same script, and don't have to look it up somewhere completely else. Because really, if scripts are just a packet to make something work, putting it in the script editor is way less efficient than writing a DLL for it, as that'll be much faster in processing...

However, that's just my opinion.
 
posted whats coming in the update on my main post(soon as i can clean up all my code and make the gui look better)let me know if there is anything else you think i should add. sorry its taken so long, but i promise this update is worth it! well except maybe those who spent forever getting their towns just right the old way, hopefully the fully integrated editor will make adding them back easy(yes that means the new version will NOT be able to import your old settings, i recommend you write them down, because it will be easy to redo with editor)

on second thought, im gonna try to see if i can get new version to read old data...we will see, no guarantees
 
Well, I don't really see the point of this_
-considering making it so you can switch between multiple map data files, let me know if anyone would like that feature.
Whatever it is you might think might be cool to have an alternative for: just put it in the very same map file, and you're good.

Other than that, I'd like to see your script in the first post, not just a demo version :p

Kepp up the good work.
 
the multi data file was cause in my game you switch between players on different worlds, would be easier with multi data files, as for putting in same file....hurts my brain to think about it lol, im sure its easy tho good idea. as for script, will re add when i post new demo, got rid of it cause it wasnt up to date, and i feel version 1.1 is a disappointment, i have learned alot since then and hope 1.2 will blow people out of the water. cause really old version really sucked
 
im having massive issues with the UI design. here is my new mock up. what do you guys think before i make it?
the red blocks will be buttons, the red text will be..well the data lol(i have classes for moding the data)

another fun fact, editor is all done with mouse, thought i should include that
2agn33l.jpg

edit:btw this is the create new town UI
edit 2:i was thinking of changing the edit buttons for numbers to a plus and minus button....
 
First of all, I like that I made it on your list of heroes... (while I'm more of an antagonist really, am I not? XD)
Oh, and heroes is actually spelled with an additional 'e' ^^


As for your interface, I think I'd like the values of the categories actually right-aligned, instead of sitting behind the words. That is also easier to do when you plan on seperate them in color (which you should).

Your problem is more on the useability side, though, I figure. So, lemme try to get something together at almost 3AM in the morning XD The think most apparent to me is that you show "castle.png" instead of the actual icon... that doesn't make much sense, however, seeing the actual filename could be important. Make sure the space you reserved in the window is enough for long filenames, though, as atm, it looks like you wouldn't even fit "Large_Village.png" ^^

As for the values, your main problem with buttons would be that you can only edit them in single steps, meaning if someone wants a map at [400, 380], he's looking at your window for quite some time and you also have to worry about making the experience a little less torturing XD
No, but what I'd like to see (not only because of that, but in general) are 'text input fields' for your Text Values. You're using Glitch's keyboard script, so that shouldn't be a problem, and if you make the right graphical appearance for that, it shouldn't be a problem for users to get it. You can then get rid of the edit buttons altogether, as clicking in the respective field will be your edit button. That gives you more space for the name box which is text-only, as well as allows both text input as well as pixel-by-pixel steps for smaller changes by the +/- keys (which you might wanna exchange for the compact, Windows-default up/down arrows, however, that's not a necessity - trying something non-standart can perfectly work out as well ^^).

Then, you definately need to change your colors. I believe red isn't the text color you planned on, however you could have black in your head actually. Let me tell you it doesn't work with the dark-blue background, so you definately wanna change either the font color or the background.

I'm confused as what the direction flag is... neither towns nor icons should have a direction as for my understanding, so I wonder what it's for. If it should be the icon, making a dpad-like interface around the actual icon being displayed might be fancier, easy to use/get and overall space-saving.

I also wonder what map ID and switch are... I figure switch is the switch ID of the switch that has to be true for the item to be displayed on the map, but I totally can't figure out map ID... can you enlighten me?

Last but not least, think of the people who might exit the window without saving - you definately want to include a cancel button here ^^


I hope I could help, but deciding some things is pretty hard over a concept with so few usage notes on it... meaning i'll definately check out your released product for further advice if you want me to ;)
 
wow i guess i have a lot to reply too, the first thing i wanna say is all those settings are for the map you travel too when you click on it(map id is the map, map x is the x of the map, direction is player direction, eta) you were mixing screen_x and map_x so i had to point this out. its funny that you have helped me so much and havent used the script at all(at least it seems you haven't) anyways: yes you are one of my heroes, you have helped me aton sicne version .5(omg that sucked) as for the right aligned i would like that as well. about the colors i have no plans at all, tho i like the multi color idea, gonna have to add that. with the plus and minus buttons nothing should get outta range but ya thats a bad idea just in case. the text input fields is something i was thinking just wasnt sure because i dont wanna add input for all the symbols that people might wanna use in town name. im down to do letters and numbers but idk about symbols.(ya i allways hated the edit button idea, so im gonna try that) as for me thinking black, now its just default in photoshop i always use "normal" color for my windows.rofl i forgot cancel good point! ok here are the setting and how you set them.
screen_x: set with mouse(so you can get town exactly where you want it. like (231,349)
screen_y: set with mouse(so you can get town exactly where you want it. like (231,349)
map_id: the id of the map that it will take you too when you click on it
map_x: the x coord of the map you are going too
map_y: the y coord of the map you are going too
direction: the direction the player is going to face
switch: the switch used to turn that town on/off(say the town hasn't been found or it burned down)
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top