|
Post by cundo on Nov 7, 2020 1:30:39 GMT
Wait there, you don't need all variables to be global. That's a problem. Windows Width & Height, MouseX & Mouse Y for example.
|
|
|
Post by Enzo on Nov 7, 2020 1:45:51 GMT
I see, why wont it input data to a$?
|
|
|
Post by cundo on Nov 7, 2020 3:03:03 GMT
I'm not sure, but since you are passing the variable to the function, don't use Global with that var. Even better use another variable name inside functions.
|
|
|
Post by Enzo on Nov 7, 2020 16:49:42 GMT
I consider it to not run because the code won't work inside functions? Odd it was working before at a semi-state as you said the same keys that didn't work for me as well, oh well going to copy and pase from fresh code with [branches] and leave it in an untouched state.
Thanks for the try guys
|
|
|
Post by cundo on Nov 7, 2020 18:04:00 GMT
The problem is you are passing variables to Functions, and then these variables are Global. Then you change their values inside the Functions. Functions work better using their own variable names, ie:
MyFunction(vara , varb , varc) vard= vara + varb + varc MyFunction= vard End Function
|
|
|
Post by Enzo on Nov 8, 2020 1:48:02 GMT
cundo I guess I do not understand when a variable needs to be a global, for subs, (Return); 'functions' only? I understand the assigning a new var fully now thanks, I remember asking Carl G about that years ago Also copy pasting [branches.branch] from earlier versions got my client to work Was having trouble with the upload download update section so I admitted them with a ' char, back to the orignial loop, your main loop also was more actionable input 'ready' at least gancing at it; logically; for the upload and download functions. Going to debug the filesystem in a fresh window with only the functions and test code to get it working correctly, I thought I had it working, maybe it's a pid issue
|
|
|
Post by Enzo on Jan 18, 2021 8:44:07 GMT
Looking to make a random map generator from a key D, W, S, G where S is a 64x64 sand tile, G = grass; with some kind of path system for W (water, i.e. streams, rivers) and D (dirt, walkways), in the same format from cundos framework; separated by a comma (see previous attached map.txt file)
Thinking the easiest way is to fill an array with all G values and add paths in after with a superimposed view of the map and drag the mouse where I'd like the paths, say a 70x70 map (which is manageable size to walk, make a 70x70 image in an editor to draw tiles on then alter array to (for sake of easiness) Green for grass and Blue for water, another color for walking paths
I have not decided how I am going to add trees buildings and maps on a level editor scale, client side it's rendered from a programmed array
|
|
|
Post by Rod on Jan 18, 2021 10:14:38 GMT
|
|
|
Post by Enzo on Jan 18, 2021 20:02:15 GMT
Hmm I looked couldn't find, but saw the icon edtior, techincally I could use that or the zoom function of any image editor, I still think randomly generated maps keying a 4x4 tile pattern to a numerical value as a key to load new maps like the fileformat post, with copy and paste; is the way to go, would allow to people to pick a config
|
|
|
Post by cundo on Jan 18, 2021 21:19:41 GMT
Different approaches to do this: one would be to have a predefined set of 'rooms' or sections then randomly 'join' them using paths. The game Shattered Pixel Dungeon, has a 'circle' map generator: that means that your start position will have at least 2 exits. Then using predefined sector starts building a map, for example clockwise: your initial room, a door to the right, a long corridor, another room and so on, until it completes a circle. It really looks random and each level is different.
|
|
|
Post by Enzo on Jan 18, 2021 22:53:02 GMT
I've seen joining sections on other games, I don't know if it will go well with the feel of only having one of each item in the game (respectfully), and also keeping a realm type feel of unique maps
My aim was to have an almost never ending wooded area and desert (although lol deserts are pretty simple) say 10-20-50 maps deep with hidden realms towards the end of the maps, basically make it on a massive scale, NPCs can be placed via random spawn at so many steps in plus or minus squares, ect.
Make it a maze with top bottom left right side of map teleport to corisponding side of new area, Game will lag with a massive map so breaking it up into smaller pieces, maybe if I made a 1400 X 1400 map and then broke it down into 20x20; 70x70 pixel, one pixel per square, Color Green = G, D for Dirt, Basically need to code a bmp parsing to an array and compile array into 20x20 sections
|
|
|
Post by cundo on Jan 20, 2021 21:36:18 GMT
You can have the never ending feeling if you do like pac-man and teleport your character from one side of the world to the other when reaching the world's boundaries.
|
|
|
Post by Enzo on Jan 24, 2021 19:02:49 GMT
You can have the never ending feeling if you do like pac-man and teleport your character from one side of the world to the other when reaching the world's boundaries. Might save on array(size) RAM
|
|
|
Post by Enzo on Jan 25, 2021 19:10:45 GMT
edit
|
|
|
Post by cundo on Jan 26, 2021 11:57:20 GMT
what are you talking about Enzo.
|
|