It is currently Sat Jul 11, 2020 5:54 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject: Re: Text RPG Design Thread [1 new, on: Screenshot, working c
PostPosted: Fri Feb 06, 2015 3:23 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Nov 15, 2012 11:38 pm
Posts: 118
Location: Los Angeles
Chicken scratch of a map generator. Perhaps attach it to the earlier code of room id generator or have this one spit out coords. Press F5 to generate new maps - hold it for map roulette :)

Code:
;Free to use and abuse. Love, Jag.

Enumeration
  #F5key
EndEnumeration

Declare generate_map()

OpenWindow(0, 0, 0, 600, 600, "map gen", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
AddKeyboardShortcut(0, #PB_Shortcut_F5, #F5key)
BindEvent(#PB_Event_Menu, @generate_map(), 0, #F5key)

Procedure generate_map()
 
  X = (WindowWidth(0)/2)
  Y = (WindowHeight(0)/2)
  line_x = X
  line_y = Y
  StartDrawing(WindowOutput(0))
  Box(0,0,600,600,$000000) ; background for contrast
   StopDrawing()
  Repeat
    If StartDrawing(WindowOutput(0))
      dir = Random(4,1) ; Change to 8 for diagonal
      If dir <> last_dir
      Select dir
        Case 1 ; north
          line_y - 20
        Case 2 ; east
          line_x + 20
        Case 3 ; south
          line_y + 20
        Case 4 ; west
          line_x - 20
        Case 5 ; northeast
          line_y - 20 : line_x + 20
        Case 6 ; southeast
          line_x + 20 : line_y + 20
        Case 7 ; southwest
          line_y + 20 : line_x - 20
        Case 8 ; northwest
          line_y - 20 : line_x - 20
      EndSelect
      LineXY(x,y,line_x,line_y,$00FFFF)
      Box(X-7,Y-7,15,15,$FF0000)
      x = line_x
      y = line_y
    EndIf
     last_dir = dir
      StopDrawing()
    EndIf
    l + 1
  Until l = 140 ; number of iterations. Won't produce exact as there is no overlap check
 
EndProcedure

generate_map()

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
End


Top
 Profile  
Reply with quote  
 Post subject: Re: Text RPG Design Thread [1 new, on: Screenshot, working c
PostPosted: Sun Mar 25, 2018 8:17 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1617
Location: Somewhere in the midwest
Well it's been a long time and things are worse than I thought. I pretty much lost everything I had been working on, I've only been able to find basic prototype based code from 2011 or so.

My XML database is gone
rudimentary command parsing is gone
screen printing routines are gone.
The GUI I had built and Macro/hotkey stuff is gone

all I got is the snippets posted here I guess I'm starting over from scratch..... :oops:

I guess I will be learning everything from scratch again :cry:

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Text RPG Design Thread [1 new, on: Screenshot, working c
PostPosted: Sun Mar 25, 2018 8:51 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2543
Location: Germany
This is more than annoying. :(

Some things you could find here in the forum.
But Purebasic has also evolved and much of what you used to program goes with a new view on things, certainly easier.

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: Text RPG Design Thread [1 new, on: Screenshot, working c
PostPosted: Sun Mar 25, 2018 9:00 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1617
Location: Somewhere in the midwest
That is true. In my case, a lot of the stuff I did was stuff that I don't think would have needed to be altered (like the RTF parsing you helped me with, that was different).

But starting over is hard mostly because, as explained in off-topic I have no programmed for a number of years, that's why losing the source code hurts more than anything.
I was very meticulous about commenting my code and explaining what was going on in every step so I could look at it years later without problems.

So all the knowledge, not just the code data, is lost from my brain :?

This is my fault for not establishing an online repository of some such.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Text RPG Design Thread [1 new, on: Screenshot, working c
PostPosted: Mon Mar 26, 2018 10:03 pm 
Offline
Addict
Addict

Joined: Sat Jul 11, 2009 4:57 am
Posts: 939
Location: United States
Hi Zack,
Have you considered using a version control software? I use bitbucket myself. It's pretty great, and they even offer free private repositories.
They also have a nice client, SourceTree, which works on windows.

_________________
▓▓▓▓▓▒▒▒▒▒░░░░░


Top
 Profile  
Reply with quote  
 Post subject: Re: Text RPG Design Thread [1 new, on: Screenshot, working c
PostPosted: Mon Mar 26, 2018 10:53 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Apr 10, 2017 6:17 pm
Posts: 354
Location: Germany
Inform could be interesting for your project. There are some years of work and several (commercial) adventures based on it.

_________________
webpage


Top
 Profile  
Reply with quote  
 Post subject: Re: Text RPG Design Thread [1 new, on: Screenshot, working c
PostPosted: Tue Mar 27, 2018 12:07 am 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1617
Location: Somewhere in the midwest
Nituvious wrote:
Hi Zack,
Have you considered using a version control software? I use bitbucket myself. It's pretty great, and they even offer free private repositories.
They also have a nice client, SourceTree, which works on windows.


I have looked into VCS before, but never really beyond the surface / considering the idea. I'm really weird, and I think I didn't want to bother with it because I don't think I can use it the way I want. I would like to manage that kind of thing from within the PB IDE. Kind of like the way Dreamweaver etc could sync projects to a web server, and even allow multiple people to check out and lock a file, etc.

But I really need to look into it. Especially if I'm going to attempt rewriting my engine from scratch. Not that I got very far, lol.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Text RPG Design Thread [1 new, on: Screenshot, working c
PostPosted: Tue Mar 27, 2018 12:10 am 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1617
Location: Somewhere in the midwest
Bitblazer wrote:
Inform could be interesting for your project. There are some years of work and several (commercial) adventures based on it.


Yes, I looked at stuff like Inform, TADS, etc. I just didn't like the way they worked I think. Also I suck at learning other peoples syntax and stuff like that. I am a control freak, I would like a finer level of control, and be able to implement and test an idea rapidly, with code I know inside and out ( hopeuflly ).

I think part of it is also the same reason I have played around with things like RPG Maker in the past, but would never attempt a serious game with it. Yes, it can be done and work quite well and professional. But it requires a lot of skill and dedication, time, etc I don't necessarily have. Also, it doesn't carry the same weight as doing it yourself and compiling an executable, I guess.. idk if that makes sense.

I've always wanted to program, and I've always wanted to make a game, so its kind of two birds with one stone. So now that I am at a point in picking up the pieces of my life where things have kind of improved, I am trying to get back into Purebasic. That's all there is to it.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye