Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / help improving matrix editor

Author
Message
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 14th Nov 2006 00:33


that is the code that i currently have for my matrix editor. My question is- how would i make a tool that smooths the matrix out? also, how would i go about making the selection of different places, go a bit slower?

I hope to eventually have it save the map, and i haven't looked veryy deeply at the file commands, so a bit of help on that would be appreciated.

parrot
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 18th Nov 2006 08:09
updated code


The only difference is this


Also, i installed a save and load feature, the saving works fine (presumably) but when i press 3 to load, nothing happens.


Any help?
also how would i go about making a tool that selects matrix segments using the mouse?

parrot
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Nov 2006 12:57 Edited at: 19th Nov 2006 11:28
[edit]

Enjoy your day.
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 18th Nov 2006 18:47 Edited at: 18th Nov 2006 19:29
im using dbpro, but i have an update matrix before the command, so shouldn't it update next time the loop goes around?

[edit] i fixed the sync rate, and the loading function. Apparently a file is created, but nothing is written to it, so when the map is loaded, it is just a blank matrix. Any help??

[another edit]


The map editor still has its problems, but here is a new problem since i tried to add a choice to either play or make a map.

Apparently there is a problem with the limb commands, any help?

parrot
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Nov 2006 23:28 Edited at: 19th Nov 2006 11:30
[...edit...]

Enjoy your day.
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 19th Nov 2006 03:37 Edited at: 19th Nov 2006 03:46
ur suggestion
Quote: "
Limbs:

Unless it's different in DBP, you have to make a mesh out of the object, then make a limb out of the mesh.

MAKE MESH FROM OBJECT <mesh number>,<object number>
ADD LIMB <root object>,<limb number>,<mesh number>

A MESH differs from an OBJECT in that a mesh is just the wire frame shape (vertices, faces,normals and UV coordinates) while an object contains many definitions including animation, texture information, bitmaps, colors, as well as vertices, faces, normals and UV coordinates.

Basically, you are adding the shape of an object (mesh) as a limb. Then, you manipulate the properties of the limb.
"


i know, but why doesn't it work? I dont really think that you read my code at all

also- how do u know the saving and loading works if you cant edit the matrix? the saved matrix would be blank, just as when u load. I also did make the changes 2 x and z i just didnt see the need to repost the code

[edit]
Okay, welll the load function changes the map for sure, but nowhere near what the saved matrix looks like, it is simply ridges its just /\/\/\/\/ but 3d on a matrix. Do you even test the code you write? if u do then i guess i just need help from someone using dbpro

parrot
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 19th Nov 2006 09:00
heh, another question and i dont want 2 make another post

I'm using it for a game i'm making called.....
(play this piece of code for cool title XD)
for a=40 to 50

set text size a
text screen height()/3-a/2, screen width()/3+a/2,"Forest Wars"
next a

wait 3000

Anyways, objects 1-4 are the boundaries, the matrix is the matrix, and the ball is ur character. I have him moving over pretty nicely, but how do i....

1. make a gun appear in bottom right corner (just a box)
2. randomly place patches of trees (so that its not just a giant forest, and so that it looks nicer)
3. texture the matrix using grass.bmp

parrot
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Nov 2006 10:36 Edited at: 19th Nov 2006 11:37
The code was a demonstration of method. The method was to save a series of y values into a file at certain x and z crossings then read them back and alter the matrix. It worked fine but maybe not for your needs.

Limbs:

Limbs have to be added in order from 1 and then up. Looks like you start adding them at 5.

Quote: "Do you even test the code you write?"

That's just a rude statement when someone offers you help for free. Better to simply say, thank you, I don't understand and need DBP help specifically.

Enjoy your day.
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 19th Nov 2006 17:09 Edited at: 19th Nov 2006 17:12
I'm sorry if that sounded like a rude statement it wasn't meant to be, and it is pretty stupid to take all your help off. you weren't helpful, but ironically your last post did

parrot
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Nov 2006 03:05
For smoothing, use a nested loop which covers every tile junction on the matrix one at a time.

Get the height of the matrix at each of these points then get the heights of the four matrix points above, below, left and right - if they are there, (some won't be at the edges of the matrix).

Get the average of these 5 points by adding them up and dividing the result by 5.

Set the original centre point height to this value.

Continue through the nested loop repeating this process on all of the tile points of the matrix.

Put the code in a function and then to smooth more, you can call the function in a loop as many times as you want.

TDK_Man

Login to post a reply

Server time is: 2024-11-14 01:10:03
Your offset time is: 2024-11-14 01:10:03