Multi-Footstep SFX?

Blitz3D Forums/Blitz3D Beginners Area/Multi-Footstep SFX?

Guy Fawkes(Posted 2012) [#1]
Hi all. Does anyone have a small example of how to load 4 textures on to a plane, and when the camera moves, depending on the texture applied to the plane, getting the correct sound effect for each part of the plane?



Any help is greatly appreciated! :)



Thanks! :)


Guy Fawkes(Posted 2012) [#2]
Here's what I have so far, I just need it to be modified to work with a multi-textured plane as opposed to a mesh. or a way of turning the infinite plane into a mesh. when the camera collides with the texture, then play that texture's sound.



Here's the code:







EDIT:



Here are the textures:



http://www.mediafire.com/?dft2v5hdgb9zeoi



EDIT 2:



-Added Fog & gravity to camera



-Added Debug mode (Ctrl + D) + lock movement if holding control keys



-Also made grass much more green



Code above :)

Last edited 2012


stayne(Posted 2012) [#3]
For starters, your sound is going to play in a continuous loop. You have no delay between your footsteps. Anyway...you need to add a flag to each surface in your world editor and monitor the surface you are standing on. You can't really differentiate between textures since you can't collide with them (someone correct me if I am wrong). You need to focus on the surface flags...not the texture. So...load your world, check all the child surfaces and set your collision types according to the flags.


Guy Fawkes(Posted 2012) [#4]
? I just wanna modify this example.


Ross C(Posted 2012) [#5]
I don't think there is an easy way of determining which texture you are touching, on a single surface, multitextured mesh.


Guy Fawkes(Posted 2012) [#6]
sadface T_T


stayne(Posted 2012) [#7]
I remember a GetTexture() native Blitz3D command at one time?


Guy Fawkes(Posted 2012) [#8]
How does it work?


Guy Fawkes(Posted 2012) [#9]
crap! its not native... is there another EASIER way around this?


Ross C(Posted 2012) [#10]
You could use the PickedU and PickedV commands from the blitz code archive. That would tell you indirectly, what pixel you were on. There in there somewhere...


wmaass(Posted 2012) [#11]
I wish I could find what a member by the handle Norc did for me years ago for my B3d based golf game. He wrote uo some routines that allowed me to check the texture of what the ball was rolling or bouncing on, thus allowing me to apply different friction.


Ross C(Posted 2012) [#12]
You must have used multi surface texturing i assume? The pickedU and V commands will let you know the texel you are currently on, and obviously the pick command will return the surface, so in that respect, it's fairly easy.


Guy Fawkes(Posted 2012) [#13]
Crap.. i REALLY wish u could find it, WMAASS.... Did u try archive.org?


Also, Ross. how exactly do I USE pickedU() and pickedV() ?


Ross C(Posted 2012) [#14]
UV's are positions on the texture. U is how far across the texture and V is how far up and down the texture. You simply multiple your texture width/height by the picked U/V and it will tell you what pixel you are on. You can then read the pixel values using this. You obviously need to have used the pick command previously.


Guy Fawkes(Posted 2012) [#15]
Um, ross. i just looked in my functions manual. there IS no "PickedU" and "PickedV" :(



I have the latest version. 1.106



There's only this:






stayne(Posted 2012) [#16]
http://www.blitzmax.com/codearcs/codearcs.php?code=515


Guy Fawkes(Posted 2012) [#17]
thanks, stayne :)


Guy Fawkes(Posted 2012) [#18]
Ok, here's what I have so far:






Ross C(Posted 2012) [#19]
Ross C wrote:


You could use the PickedU and PickedV commands from the blitz code archive



You don't say what is wrong with the current version of your code?


Guy Fawkes(Posted 2012) [#20]
When I click the plane, it is NOT returning ANYTHING for PickedU() OR PickedV()


Ross C(Posted 2012) [#21]
I don't think Planes have UV co-ords, because they are infinite. You'll need to create your own plane, or use a flattened cube.


Guy Fawkes(Posted 2012) [#22]
... can someone PLEASE just show me a modified example of the above code instead of all this crap "o u cant do this, o u cant do that"... -.-


GfK(Posted 2012) [#23]
>>>... can someone PLEASE just show me a modified example of the above code instead of all this crap "o u cant do this, o u cant do that"... -.-

Why should anybody help you when you behave like this? You have one of the lousiest attitudes i've ever seen on this forum.


Guy Fawkes(Posted 2012) [#24]
ignoring ALL jerks. :)


GfK(Posted 2012) [#25]
>>>ignoring ALL jerks. :)

By that logic you should be ignoring yourself.


Ross C(Posted 2012) [#26]
Your problem is, you don't have the slightest clue how that code up there works. How it it going to help you, if someone modifies it? I think you need to re-evaluate the application you are using. Maybe you should try a game builder language?

Personally I don't have the time, or the desire, to fix/modify all the pieces of code you have knit together. I'm very willing to help you learn the language, but that's it.


...instead of all this crap "o u cant do this, o u cant do that"... -.-



...

Last edited 2012


GfK(Posted 2012) [#27]
Oh ross, don't. He ain't worth it.


Ross C(Posted 2012) [#28]
Indeed.


Guy Fawkes(Posted 2012) [#29]
Nor r u, Gfk. ur rude comments mean NOTHING to me. :) So go about ur day :)


Matty(Posted 2012) [#30]
Thundros - you may want to read this, it may help you on your online travels...

http://www.albion.com/netiquette/corerules.html


Guy Fawkes(Posted 2012) [#31]
Matty, u may want to back off and leave me alone. now im ignoring YOU too. :)


Adam Novagen(Posted 2012) [#32]
Alright, time for me to put a stop to this silliness with some simple programming logic.

What you want can't possibly exist, Thundros, because a Plane only has two polygons that are always moved by Blitz to keep it looking "infinite." Why is this important? Because it's impossible to have, say, a grass texture on one part and a sand texture on another part. This is because there are no parts to a Plane. You can have more than one texture on it - "multilayered" texturing - but they'll just be spread over its entirety, each on top of the other. So, trying to determine "which of four textures you're standing on" is impossible simply because you will always be standing on all four textures at once.

There are other ways that might work, if you ditch Planes and use something else, but I haven't done much in-depth "true 3D" work so I have no suggestions that wouldn't already be either in the code archives here or the Blitz3D samples.


Guy Fawkes(Posted 2012) [#33]
Ok, then how would YOU do it?


-=Darkheart=-(Posted 2012) [#34]
Thundros, you need to use a Quad not a plane. Quad's are flat, like planes but have x,y corrdinates so they can be whatever size you want and U,V coordinates that allow you to work out where you are on the texture.

You can find some useful functions for using and creating quads here:

http://www.blitzbasic.com/codearcs/codearcs.php?code=1603

In your case you might find it easier to have simply four quads positioned together each with a different texture. Then rather than messing about with the U,V coords you could just use the "Picked Quad" function.

I hope this helps.

Darkheart


Matty(Posted 2012) [#35]
Alternatively, since a plane or quad is able to be represented as a 2d surface simply use a low res 2d array containing the definition of the ground point at that location and simply do a 2d lookup into the array at the camera position. No need to use pick commands at all, nor textures. That's how i would have done it in the past.


Guy Fawkes(Posted 2012) [#36]
Quads work for me, but that still doesnt explain how i can change my footstep based on the texture. i would need an example of how PickedU() & V work when CREATING a footstep, in order to understand how it works.


Matty(Posted 2012) [#37]
To use picked u and v -
These return the location on the texture that the pick command struck. If you had a ground texture with 4 quadrants with a different type of "ground" in each quadrant then your picked u and v would determine which quadrant of the texture you are in. For example the u and v values may be 0.25 and 0.75 respectively. This would represent a pick in the upper left quadrant of the texture. If that quadrant was grass then you would play the grass footstep sound.

Hope that makes sense.


Guy Fawkes(Posted 2012) [#38]
Ok. but how do I create a quad plane?


stayne(Posted 2012) [#39]
Stop using Blitz natives bud. Fire up Blender and create your models there. For a plane, just create a big plane, subdivide it to fit your needs and give it some UV coords. If you don't know how to do that, then learn. Google "how to UV map in blender". Teach yourself. Show these guys that you are willing to do the work. You are beyond lucky that you are still able to post here. You need to grow up, accept the fact that you are pasting code you know nothing about and have more patience. Folks here are helping you because it is a good feeling to help someone...but it will only last so long until they realize you don't appreciate it. You're fighting everyone because you are stubborn. Relax, breathe and learn. Let it sink in and take their advice and one day you'll be on their side helping others. These guys are all very good people and they care. I hope that is obvious. Don't ruin it. Turn yourself around and start behaving man.


Guy Fawkes(Posted 2012) [#40]
blender is the WORST program ive EVER used. i dont LIKE to model. -.- Some ppl arent as LUCKY as u to be able to do that. -.-


stayne(Posted 2012) [#41]
Lucky? No, I taught myself to use it because it's a great tool and can do anything the expensive modeling apps can do. Just takes a long time to learn. I respect the fact that you don't want to do it. Dude you need to stop capitalizing certain words. It comes off as yelling to most people. Has more of a negative effect than you think.


Guy Fawkes(Posted 2012) [#42]
As I said. some ppl arent as lucky as u... -.-


Guy Fawkes(Posted 2012) [#43]
Alright... I'm using this rather simple quad code I found in the archives. I am trying to create my OWN Quad texturing function... I need help fixing it up a bit. Now u CANT say that im not trying.







I based it off of the QuadRotate() function...


Any help would be greatly appreciated! :)


Thanks! :)

Last edited 2012


stayne(Posted 2012) [#44]
What do you mean by "fixing it up"?


Guy Fawkes(Posted 2012) [#45]
i MEAN, I need to know if im doing this texture function right, and if not, how CAN i do it right?


RifRaf(Posted 2012) [#46]
I think Ross has been helping you for extensively for a long time, I love how when he finally calls you on your behavior you dismiss him like a bad apple and move on to the next sucker who will waste their time.

Class act


stayne(Posted 2012) [#47]
Spoiled rotten. Reminds me of my ex-wife. Way to burn your bridges man.


Guy Fawkes(Posted 2012) [#48]
im not trying to fight ANYONE here. do u ppl not get it?


Drak(Posted 2012) [#49]
The fact is Rez that you ask for help over and over and over again without ever really trying to figure out why what is happening is actually happening. Like I've told you many times before:

Use other people's code to learn. Use other code if you must as a basis or learning platform for your OWN code. If you didn't write it, then chances are you will never understand what everything actually does. So if you continue to piece projects together using other people's code you will never, ever learn anything.

I like helping people with their programming questions and problems, but it's really frustrating when the person you help doesn't seem to try to figure out anything on their own, or even understand how their code works.


_PJ_(Posted 2012) [#50]
As Drak says, and numerous others, myself included, have repeatedly told you - you wont ever get any better or be able to accomplish anything of value without staring off with the simple.

This ios the Nth time you've been working on something way over your head and beyond our capabilities built up from snippets and examples bolted so poorly together.

I really insist that you start with something simple. Work on your organisation first, so that when you DO use other peoples' code and incorporate snippets from elsewhere (AND - when people wish to help you with certain areas) - yyou can analyse the individual specifics of the code and effect changes without or at least mitigating the risk of introducing more issues that can cripple the entire foundations / structure of your project.

There are examples, archives, sources and snippets of all kinds all over the internet for every programming language imaginable encompassing damn near every technique or possible scenario that may ever be encountered. However, without the basic understanding of what you essentially want to accomplish in your code (what the underlying machine interpretation NEEDS to be doing rather than just what your end result should be) and HOW the code you acquire from elsewhere likewise achieves these goals, then you wont ever progress - you lack the fundamental ability of programming which isn't how to create a program to achieve a result but rather, the KNOWLEDGE of what actually occurs to REACH that result.

A very simplified example:

a1$="Hello"
a2$=" "
a3$="World"


compared to

n1=6
n2=2
n3=7

BANKS=createbank(12)

a1=CreateBank(n1)

PokeInt BANKS,0,a1

PokeByte a1,0,72
PokeByte a1,1,101
PokeByte a1,2,108
PokeByte a1,3,108
PokeByte a1,4,111

a2=CreateBank(n2)

PokeInt BANKS,4,a2

PokeByte a2,0,32
PokeByte a2,1,0

a3=CreateBank(n3)

PokeInt BANKS,8,a3

PokeByte a3,0,87
PokeByte a3,1,111
PokeByte a3,2,114
PokeByte a3,3,108
PokeByte a3,4,100
PokeByte a3,5,13
PokeByte a3,6,0



Essentially, these are the same thing,, the second sort of resembles the machine code approach to accomplishing the same as the first one - in a simplistic kind of way.
The point is, that when you ask someone to help you with code, and they provide the solution (as in the first example) - it may have the desired effect, but without the kind of understanding that it is really just a glossy example of the underlying process of the second example, you will find it difficult to work with that code to suit your own ends.
Admittedly, it's quite obvious from the first example what the result will be and how to alter it (i.e. change the strings etc.) but consider what happens with a more complex solution.

I'm not advocating that you use the second example style in place of the first - but it's important to know that you can UNDERSTAND that the second example is WHAT'S ACTUALLY BEING DONE (kinda - for the sake of this example) when the code runs.

If you can answer these questions about the second example, whilst condsidering the context of the first example, then that's the key to understanding how code typically works.

What might BANKS be a representation of?

What do the numbers (here as xxx) such as PokeByte a1,4,xxx or PokeByte a3,3,xxx represent?

Why does each a1, a2 and a3 bank have the extra '0' value?

What is the purpose of the '13' in : PokeByte a3,5,13?

Last edited 2012


Guy Fawkes(Posted 2012) [#51]
I rather would use something more simple than pokebyte, so i can learn how to do multi-footsteps


_PJ_(Posted 2012) [#52]
That's my point...

If people just give you the "simple" solutions, you wont learn anything without knowing what the underlying complex solution needs to do.

Once again, you're trtying to run before you can walk by attempting something which while in theory sounds simple enough, but actually requires a detailed understanding within B3D's 3D commands and a good grasp of time-relative procedural loops. You clearly dont possess these skills, so you're not going to be solving this problem anytime soon.

Asking for help when you don't really know what it is that your code should be doing (by which I mean, the processes it should be undertaking, NOT just the final result) means that you're asking someone else to code the whole thing. You provide little more than a snippet of code that you also obtained from the archives which creates a quad.

When you ought to be thinking about what your code should actually be doing:

1) Use a mesh surface which has UV coordinates for its texture layers
2) Identify the contact tri
3) Cross-reference the UV coordinates of the contact tri's vertices with the texture map
4) From the coordinates on the texture map, identify the particular 'material' type of the texture, i.e. wood or metal etc.
5) Select the correct footstep sound for that particular 'material'
6) Ensure playing of the sound only when there is initial contact or when continuous contact is moving.


ake each of these steps ONE BY ONE in turn, and work hard on them separately.
THEN when you get stuck, you are only stuck on a small part of the code which will be much easier to obtain help with, and you will be putting a decent level of effort in yourself without asking people to code an entiure system for you.


Guy Fawkes(Posted 2012) [#53]
i dont roll with difficult solutions. now stop fighting with me plz, and either teach me, or dont.


H&K(Posted 2012) [#54]
either teach me, or dont.
Teach me?
You dont want to be taught. you just want it done.

You: Teach me how to play like Mozart on the piano.
Others: Ok, well first you need to practice scales.
You: Stop telling me about scales, just teach me how to play like Mozart.
Others: We are trying to tell you. You cannot just start with an opera, you need to get some basic training first.
You: i dont roll with difficult solutions. now stop fighting with me plz, and either teach me, or dont.


Yasha(Posted 2012) [#55]
either teach me, or dont


Everybody here for the last two years or however long it's been has been trying to do this.

It is you who are flatly refusing to learn anything because you want to copy code you don't understand.

You have wasted the time and patience of many people here with this, so let's make one thing very clear: this is as simple as it gets. You are the one who doesn't want to be taught.

As I've said before, you need to either be willing to learn, or be willing to admit to the rest of us that you really have no interest in learning and just want someone to write for you. This is OK, just hire someone and they'll very happily do it. Pretending you want to learn when you really want to copy is not OK and wastes our time and yours.


Guy Fawkes(Posted 2012) [#56]
.

Last edited 2012


Yasha(Posted 2012) [#57]
What u mean ppl cant understand is that i think a certain way.


Yes, you think that bawwwing "I'm special!" loudly enough will somehow change the way the world works and cause information to just osmose into your brain without any effort or reading on your part.

If it's true that you have some kind of difficulty learning, that means you need to put more effort in, not less. You're currently asking for it to work both ways: you apparently don't learn normally, so ...you want magic to happen.

To borrow the immortal wisdom of Euclid, there is no Royal Road to programming.


Guy Fawkes(Posted 2012) [#58]
I DO have a disability. and I dont give a crap WHAT u think about me. Im willing to try if one is willing to teach me. in my OWN way... -.-


H&K(Posted 2012) [#59]
Programming also needs you to think in a certain way. A way we have all tried to get you to think in, but you seem unable to.
Unfortunately, of the two ways of thinking, "your way" and the "way you need to", the immutable one is "the way you need to"

Its like learning French. You start with a few basic words and phrases, which you PRACTICE, then after a bit you can "Think" in this very limited French. Then you use this limited French to learn more French, until in the end you cam think in French and your own language. You dont need an English speaker to teach you French, or a Spanish speaker. Oh they might be able to speak English and Spanish, but what's important is that they can think in French.

Now to computing, we all here think in various levels in "computer" some of us know different accents, and dialects, but generally everyone on this site thinks in about the same dialect of "computer"

"What u mean ppl cant understand is that i think a certain way. i dont know WHY u cant get it through ur thick skull..."
We do understand this. BUT can you not see we need you to learn another way of thinking otherwise you cannot understand the answers. This is why one in five of your threads end with someone recommending a different package ie Games Creator, or FPSC


Ginger Tea(Posted 2012) [#60]
My Japanese teacher was German ...

I don't know what exactly "your own way" entails, but I would like to know how you got on with Rob's method of "translating code into English / spoken language of choice" and the other way round. That way it shows to us you understand what code samples you are supplied.

Way back when, when you first got here, it was more "gimme da codes" but not, what you would ask would be a working example of how to do something for you to learn from.
But a working example ends up being the solution (it's the way programming ends up), not a prod in the direction you need,

Hypothetical EG Mouse look
A fully working mouselook is in the demo folder (iir) but its basic and lacks tweaking options, but it's a good starting point once you've looked into mouse commands etc, but if you never read up on them and just use the basic mouselook and want to improve it, we would just point you at the online docs then wonder why 20 posts later you still had not got it.

hence why you had a lot of frankenstien cookie cutter code with conflicting lables.

Compile, seems legit, C+P, I doubt anyone actually thoguht you read any of the code after a while.

Every time we get to this point in a thread you might think we are 'ganging up on you', but we are not (not most of us) we just want to get through to you that some things cannot be done 'just like that' the Mozart analogy is a good one and with your 'troll code' in another thread, that I am still unsure if you meant for it to be fantastically flawed for the lolz or you genuinly thought you posted legit code and rob's blitz to english translation of what it was doing, says that if you were learning to be a pianist, chords and scales would be a forign concept as you smash down on random key's on a £300 Yamaha.


GfK(Posted 2012) [#61]
i dont roll with difficult solutions
...then programming is not for you. You should probably find something easier to do.


_PJ_(Posted 2012) [#62]

i dont roll with difficult solutions.

So stop asking for help with difficult areas. Like I've suggested NUMEROUS times now, work in simple steps one at a time, breaking down the difficulty into smaller, manageable problems with simpler solutions.

now stop fighting with me plz,

I'm not fighting with you, I'm trying to help you. Believe me, if there was a quick and easy solution oto the kinda requests made, then it woul be no problem for someone to go ahead and offer an example, but the thing you need to face up to is that there aren't always such simple solutions, and for someone to work out the complicated solution and provide it for you isn't helping anyone, since you wont understand how it works to make it suit your particular code style - that's the real issue here, that you need to understand how code works before you attempt to use the code from other people etc.

and either teach me, or dont.

Im willing to try if one is willing to teach me. in my OWN way... -.-



Teaching is a two-way process. This isn't a fastrack learn-to-blitz course either, and even if any of the users here are qualified tutors, they aren't here professionally or otherwise to teach - only that due to the nature of a cimmunity forum, advice and expertise can be shared as well as trying to help others out at the users' own discretion.
As such, there's no reason why people (many of whom here do have professional background or experience with the programming industry), should change tack and deviate from tried and tested methods of coding standards and conventions just to suit your peculiarities. If you're THAT interested in LEARNING then you should do your best to heed what is being taught, rather than expect someone to teach you by somehow being able to implement complex functionality into your own garbled code - expecting it to also be able to work flawlessly with later changes which you dont even express.

It seems that "your way" relies on posting a qquestion which requires a complicated solution, then complaining when being told that the solution entails a lot more work than you bargained for, or is way beyopnd your current grasp of the language.

There's been so many suggestions and good advice givern to you in the past, but you've never taken it, so it's no wonder that people get frustrated again and again.


Guy Fawkes(Posted 2012) [#63]
.

Last edited 2012


RemiD(Posted 2012) [#64]
If i had to achieve this effect, i would have used one of these methods :

1)During the loop, use the pickedUV command to read the color of the pixel of the texture, and depending on the color you know what kind of material it is and you can play the corresponding sound. I think this will be slow.

2)Use the technique explained above to store the kind of material (illustrated by the color of the pixel) in an array where each entry represents a 1mx1m area. During the loop you check what kind of material is below Player/Npcs depending on their coordinates. I think this will be fast.

3)Build your level with several meshes, one for each kind of material, and set one group of collision for each kind of material. During the loop, when you check the collisions, you know what kind of material the Player/Npcs are in collision with. I think this will be fast enough if you use zones to activate/desactivate collisions.

These are ideas, but i won't code your game ;)

Last edited 2012


Guy Fawkes(Posted 2012) [#65]
Ok, so how would I get the color of each pixel in the texture?


RemiD(Posted 2012) [#66]
If you use a square ground, or a terrain, or tiles, it is easy because you know the width and depth of your meshes (in Blitz3d units) and you know the width and height of your texture (in pixels).

If you use irregular shapes, it will be easier to use several groups of collisions.

If you really want to find what is the color of a pixel on a picked mesh, there are examples on how to do this in the code archives.

Here :
http://blitzbasic.com/codearcs/codearcs.php?code=515

Here :
http://blitzbasic.com/codearcs/codearcs.php?code=2895

Here :
http://blitzbasic.com/codearcs/codearcs.php?code=514

Here :
http://blitzbasic.com/codearcs/codearcs.php?code=794


Guy Fawkes(Posted 2012) [#67]
Thanks, Remcoder :)


Guy Fawkes(Posted 2012) [#68]
Is there not an easier, more accurate way to do this?


H&K(Posted 2012) [#69]
You could pick a random sound, and draw that texture under your feet


Ross C(Posted 2012) [#70]
You can't really get more accurate than reading the actual color of the pixel. Maybe you should skip this, and work on getting everything else up and running. Work on the basics and add the special things later.


Kryzon(Posted 2012) [#71]
Ok, so how would I get the color of each pixel in the texture?

Don't do pixel reading... that's way overkill.

- Detach the environment's surfaces (wood, grass etc.) as different meshes. Name each one with their material's name (ground mesh named "Dirt", grass mesh named "Grass" etc.).
This is all done with a modelling tool (3DS Max, Maya etc.), not a single bit of code.

- LinePick from character's head towards -500 Y. Store the returned value in a variable "pickedMesh".

- "pickedMesh" is the variable holding the entity that was picked. Since every surface of the environment is a separate entity, they can all be separately picked.

- Select...Case block, play the appropriate sound based on EntityName( pickedMesh ) if your character is in the right animation frames (frames where either of his feet is stepping on the ground).


Guy Fawkes(Posted 2012) [#72]
Ok, Ross. How would I do this?

Last edited 2012


Ross C(Posted 2012) [#73]
The link that RemCoder posted does this:

http://blitzbasic.com/codearcs/codearcs.php?code=515

Once you have the PickedU and PickedV, you simply multiple the texture width by the PickedU and the texture height by the PickedV. This will giev you actual pixel locations on your texture.


Guy Fawkes(Posted 2012) [#74]
Ok, and then what? how do I tell it which sound to play according to the pixel color?


Ross C(Posted 2012) [#75]
Use an IF statement. Basic 101.

if pixel = green then playsound walking on grass


Guy Fawkes(Posted 2012) [#76]
Yea, but there's alot of shades of green o.o


Let me rephrase that...

What are the ranges from 0 to 255 of red, green, and blue?

Last edited 2012


Ross C(Posted 2012) [#77]
I don't know. Ranges of what? Colours of green? Crack open paint and you'll see. It's very subjective what still qualifies as green if you go far enough into yellow. Maybe go for Kryzons suggestion. If you aren't using a solid enough colour, then you'll have to cover all the ranges of pixel i guess.


Guy Fawkes(Posted 2012) [#78]
What if I wanted to use the Blitz Tiles code for my level though? How would I do the same thing as Kryzon said if i cant cut up the level?


Ross C(Posted 2012) [#79]
I have no idea.


Guy Fawkes(Posted 2012) [#80]
Ross is actually clueless for once?! *GASP* O_O That's a first :O


Rob the Great(Posted 2012) [#81]
Use an arbitrary bounding box to know where the player is and what texture should be located beneath the character. Something along the lines of this:
;PSEUDO
Global texturesound$

If EntityX(player) >= -100 and EntityX(player) <= 100
   If EntityY(player) >= -100 And EntityY(player) <= 100
      If EntityZ(player) >= -100 And EntityZ(player) <= 100
         texturesound$ = "Dirt"
      EndIf
   EndIf
EndIf

If EntityX(player) >= 500 and EntityX(player) <= 700
   If EntityY(player) >= -100 And EntityY(player) <= 100
      If EntityZ(player) >= 500 And EntityZ(player) <= 700
         texturesound$ = "Sand"
      EndIf
   EndIf
EndIf

;If your character's frames are at the right spot
   Select texturesound$
      Case "Dirt"
         PlaySound(dirtsound)
      Case "Sand"
         PlaySound(sandsound)
   End Select
;EndIf

This is ideal for changing the sounds if the player enters inside the space of an imaginary box. Personally, I would prefer to use the individual entities method as it is more accurate, but this will work. All you need is to provide a minimum and a maximum value for EntityX(), EntityZ(), and optionally EntityY(). To get these values, walk along the edges of the texture seams, recording the values at the corners. Note that this will only work if the textures are rectangular and are lined up with Blitz x,y,z coordinate system.


Guy Fawkes(Posted 2012) [#82]
OR I could use a zone system like I was thinking of doing, only with different shaped zones! :D Thanks, Rob! :)