Scrolling Game Development Kit Forum
Welcome,
Guest
. Please
login
or
register
.
2010-09-09, 04:42:39 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
8920
Posts in
1007
Topics by
168
Members
Latest Member:
mogzdogz
Scrolling Game Development Kit Forum
SGDK Version 1
Help/FAQ
How to scroll map editor horizontally for large tiles
« previous
next »
Pages:
[
1
]
Author
Topic: How to scroll map editor horizontally for large tiles (Read 2089 times)
Eastfist
Contributor
Regular
Posts: 54
How to scroll map editor horizontally for large tiles
«
on:
2008-12-20, 01:57:11 PM »
Hey gang,
Long time, but still kicking it. Working on my modified version of 1.4.6 (I'll release it if I ever finish Runsetter, I want it perfect). Ben, was wondering how you've implemented the map editor. I've noticed that it will scroll vertically for tiles larger than the screen resolution, but not horizontally. For example, if my screen resolution is 1024x768 and I have a bitmap that is 2048x2048 with tiles set at 1024x1024 each, then I can scroll vertically to select the tiles in view, but not the tiles not currently in view. Here's the lines of code I've altered, but don't seem to be taking effect:
This is inside the MapEdit class...
...
ElseIf EditMode = 1 Then
...
If MouseX > HorizontalResolution - 16 Then
TSOffsetX = TSOffsetX + 8
If TSOffsetX > Disp.HimetricToPixelX(theMap.MapLayer(EditLayer).TSDef.Image.Width) - HorizontalResolution Then
TSOffsetX = Disp.HimetricToPixelX(theMap.MapLayer(EditLayer).TSDef.Image.Width) - HorizontalResolution
End If
End If
If MouseX < 16 Then
TSOffsetX = TSOffsetX - 8
End If
If TSOffsetX < 0 Then TSOffsetX = 0
Disp.DrawTile MouseTS, 2, MouseX, MouseY, 0, 0, HorizontalResolution, VerticalResolution, True
Theoretically, it should work the same way it's drawn during runtime, so why isn't it scrolling?
Logged
"What's in a game?" Juliet says to insult Romeo.
bluemonkmn
SGDK Author
Administrator
Fanatic
Posts: 2146
Re: How to scroll map editor horizontally for large tiles
«
Reply #1 on:
2008-12-21, 09:21:46 AM »
There are a lot more lines of code than those that refer to TSOffset, which is what determines where the tileset menu is drawn. Did you change all of them to include the new TSOffsetX variable?
Logged
Ben Marty
Scrolling Game Development Kit 2
Eastfist
Contributor
Regular
Posts: 54
Re: How to scroll map editor horizontally for large tiles
«
Reply #2 on:
2008-12-21, 08:30:30 PM »
I did a search through the class, and realized I had to add the new offset variable to the PaintMenu method too and it's working now. Thanks, Ben.
Logged
"What's in a game?" Juliet says to insult Romeo.
SmartBoy16
Contributor
Fanatic
Posts: 554
Current Project: RANAT: BtT
Re: How to scroll map editor horizontally for large tiles
«
Reply #3 on:
2008-12-21, 09:14:29 PM »
hey! if you're not doing anything special, could you figure out a way to have SGDK1 to play music from a cd? this would be so helpful since i want to use high quality music with my RANAT game without wasting 100MB+ of disk space (it's not the space that's the problem, but the loading time and memory space).
Logged
SmartBoy16
The RANAT Foundation: Before the Truth
http://www.box.net/RANAT-BtT
Eastfist
Contributor
Regular
Posts: 54
Re: How to scroll map editor horizontally for large tiles
«
Reply #4 on:
2008-12-21, 10:59:44 PM »
Hey SmartBoy16,
I'm not really qualified to answer that kind of request. But as far as I know, DirectX doesn't support MP3s anymore because quartz.dll is replaced with every new incarnation of Windows Media Player/Direct X/DirectShow and that's what SGDK uses to play media. According to what I've read somewhere, Microsoft disabled support for MP3s in DirectX/DirectShow because they don't want developers messing with MP3 proprietary technology (I could be wrong). You could try to rollback that dll, but I doubt it'll do any good. I've tried to find a workaround too, but no luck. As for referencing hq audio from a cd, you can probably alter the .gdp file that is output by the app. Open it with Notepad, find the media section and put something like this: "E:\audiofile.wav" Of course, you won't be able to determine which drive the user has a cd-rom installed in.
To create hq audio, use MediaCoder and convert the MP3 to a hq WMA file. Should be compatible, I tested it.
Logged
"What's in a game?" Juliet says to insult Romeo.
Jam0864
Contributor
Fanatic
Posts: 742
Re: How to scroll map editor horizontally for large tiles
«
Reply #5 on:
2008-12-22, 12:34:26 AM »
if u have all the game files on the same discs could you use relative paths?
for example if the game file was e:/gsad.gdp, couldnt the reference to the audio file in the gdp be /music/fdasd.wav?
Logged
SmartBoy16
Contributor
Fanatic
Posts: 554
Current Project: RANAT: BtT
Re: How to scroll map editor horizontally for large tiles
«
Reply #6 on:
2008-12-22, 11:05:13 AM »
Quote from: Jam0864 on 2008-12-22, 12:34:26 AM
if u have all the game files on the same discs could you use relative paths?
for example if the game file was e:/gsad.gdp, couldnt the reference to the audio file in the gdp be /music/fdasd.wav?
then the game would attempt to save the game on the CD. the best thing i could do though is ask the person which drive their cd player is on and then send it to them for whatever drive they use. (like, for most people, send a GDP that contains paths to D: and another person to E: )
Logged
SmartBoy16
The RANAT Foundation: Before the Truth
http://www.box.net/RANAT-BtT
Eastfist
Contributor
Regular
Posts: 54
Re: How to scroll map editor horizontally for large tiles
«
Reply #7 on:
2008-12-22, 12:49:18 PM »
Actually, now that I think about it, Jam0864 might be right. As long as the paths are relative to the .gdp file, you shouldn't have to worry. Create your project on the hard drive and when it's ready to go, then burn all the files onto a CD. Just remember to test the CD on another computer before you distribute it because it might still reference files on the hard drive you developed the project on.
Logged
"What's in a game?" Juliet says to insult Romeo.
SmartBoy16
Contributor
Fanatic
Posts: 554
Current Project: RANAT: BtT
Re: How to scroll map editor horizontally for large tiles
«
Reply #8 on:
2008-12-22, 12:56:36 PM »
that would work, but the only problem is that whenever you try to save the game it may try to save onto the CD (i think i said that before) and plus there would be loading times (but then again, that probably expected of a CD) is there a way to direct where the save file is located?
Logged
SmartBoy16
The RANAT Foundation: Before the Truth
http://www.box.net/RANAT-BtT
bluemonkmn
SGDK Author
Administrator
Fanatic
Posts: 2146
Re: How to scroll map editor horizontally for large tiles
«
Reply #9 on:
2008-12-22, 06:29:54 PM »
No, I don't think you can control where the saved game goes. That's a good point... maybe I should investigate this in SGDK2 and make sure at least in SGDK2 that it's possible for user-written content to go do the user's directory instead of the executable's directory. That's the normal thing for modern programs now. I just want to make sure there's no easy way for saved games to overwrite other important files.
Logged
Ben Marty
Scrolling Game Development Kit 2
SmartBoy16
Contributor
Fanatic
Posts: 554
Current Project: RANAT: BtT
Re: How to scroll map editor horizontally for large tiles
«
Reply #10 on:
2008-12-23, 05:16:46 PM »
Have the programer/gamer set the location? maybe have some kind of line in the code that states the Save folder. OH!! Roller Coaster Tycoon lets you set where exactly you want to save your file via SaveAs... box. Maybe you should also have a special .sgdk2sav file that instantly starts up where you left off when you open it.
as for RANAT, i might have to compress the music files. my sound recorder that i use has a special MPEG Layer type thingy format that cuts down its size without much loss of quality. ill use that then.
Hey, over 300 posts!
«
Last Edit: 2008-12-23, 05:22:12 PM by SmartBoy16
»
Logged
SmartBoy16
The RANAT Foundation: Before the Truth
http://www.box.net/RANAT-BtT
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
SGDK Version 2
-----------------------------
=> News and Announcements
=> Help, Errors, FAQ
=> General Discussion
=> Projects
-----------------------------
SGDK Version 1
-----------------------------
=> News and Announcements
=> Help/FAQ
=> General Discussion
=> Script
=> Projects
-----------------------------
General
-----------------------------
=> Game Development Artistry
=> Off-Topic
Loading...