123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|517|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Character Select

Page : 1 2 Next 3
Prev
Sat, 22 May 2010, 07:57
ShadowIce
Hi all.

Once again, I have a small problem.

See, What I need is for the bottom sphere in this character select to change from blue to yellow.

Problem is the spheres are still white, and not changing colors as each sphere passes through the bottom.

watch this video.

this is EXACTLY the way I need it.

https://www.youtube.com/watch?v=tY6KVgAE9BY

Thanks for the help!

~Shadow
Sat, 22 May 2010, 08:15
HoboBen
Been a long while since I used Blitz, but skimming through the help files, your options seem to be CreateBrush & BrushColor or perhaps more simply if your spheres don't have a texture you can just use vertex colors:



IIRC, the red, green, blue values should be in the range 0 - 1.0

-=-=-
blog | work | code | more code
Sat, 22 May 2010, 08:41
ShadowIce
i forgot to add my code.


Sat, 22 May 2010, 12:20
Mog
There is such a feature as the EDIT button, also your code is missing the media so it makes it hard to test it.

The problem is, you're setting your colors to white when SelectedArray is 5(?). You need to switch the colors every time you hit a key, or just have a catch-all loop to run through each entity and color the appropriate sphere you have selected. Give me a bit and i'll post some fixed code- you also seem to have an 'off by one' flub here.


*EDIT* It's hackish, but try this - Also, put your media back in, I had to change a few things:


-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene
Sat, 22 May 2010, 16:36
ShadowIce
solved!

thanks mog!
Sat, 22 May 2010, 17:23
ShadowIce
I have 1 more small problem..

I need the character to load above the selected sphere, and always look straight ahead as if it were looking at you.


model:

https://www.psionic3d.co.uk/wp-content/uploads/2009/07/dwarf.zip
Sun, 23 May 2010, 07:02
bram32
Position the character at 0, 0, 0. This position is relative to it's parent.
Rotate it using this:
RotateEntity dwarf1, 0, 0, 0, true
Sun, 23 May 2010, 07:36
ShadowIce
thanks!

ok. 1 more question.

how can i switch

between each model,

everytime the player switches

the ball?

basically, how do i get it
to work like in this video?:

https://www.youtube.com/watch?v=tY6KVgAE9BY


Sun, 23 May 2010, 09:37
bram32
Simply free the previous one, load the new one.
Sun, 23 May 2010, 09:40
ShadowIce
um, my code isnt working right.

thats what i tried to do.
Sun, 23 May 2010, 09:54
ShadowIce
see?


Sun, 23 May 2010, 10:01
bram32
Well, instead of trying to improve this code, write a new, clean code that deals with only two models and nothing else.
Then, make it so that you can switch between the two models using the keyboard.
If it all works -and you understand how it works- you can combine this new code with your excisting one.

Sun, 23 May 2010, 10:03
ShadowIce
i'm not going to rewrite
an entire code for this 1 problem.

do you know how long it took to write?months..

ANYWAY.

here's the new code.

it's close to what i need, but not on target.


Sun, 23 May 2010, 10:25
JL235
Months for 150 lines of code? That's pretty slow.

His suggestion wasn't to rewrite the code, it was to protoype a version that switched between two models and then integrate the workings from that into your current code.

The one thing I disagree with is that you should build a system that can switch between any number of objects, not just two.
Sun, 23 May 2010, 10:29
ShadowIce
i am trying to do that.

but 1st,

i have to build a prototype

with just 2.
Sun, 23 May 2010, 11:53
bram32
Yes, prototype first, then intergrate with the existing code. Beside that, if needed, there is nothing wrong with rewriting your code. It helps to remember and learn.
Reason of my advice is that, in your code, you are using the same variable to store two handles. That means that the first object cannot be reached anymore.
In a way, you're doing something along the lines of this:

Now, two models are loaded, but you can only use the second one. Better is, to use something like this:

Then, both objects can still be used.
Sun, 23 May 2010, 12:13
ShadowIce
ok, it's getting closer.

now what can i do

to switch between models?


Sun, 23 May 2010, 12:36
bram32
Well, instead of trying to improve this code, write a new, clean code that deals with only two models and nothing else.
Then, make it so that you can switch between the two models using the keyboard.
If it all works -and you understand how it works- you can combine this new code with your existing one.
Sun, 23 May 2010, 13:19
ShadowIce
again, i'm not going to rewrite the code.

not when i'm this close.

i might as well just ask my friend for help..

thanks alot..
Sun, 23 May 2010, 13:21
ShadowIce
and no, i don't want you to do it for me.

i just want something other than

"o, i think you should rewrite it cuz it's wrong"

it is NOT wrong..

there is only one SMALL glitch..
Sun, 23 May 2010, 13:31
shroom_monk
I don't think he's saying to rewrite the whole thing from scratch. What he means is to test separately in another program the piece of code you need to fix, then, once it's working and you understand how it works, use that piece of code in your main program.

He's not saying the existing code is wrong - as you say, it's just one small glitch. But small glitches in long pieces of code are easier to fix if you isolate them and test fixes for them in a small, controlled environment where you don't have the whole program interfering.

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Sun, 23 May 2010, 13:36
ShadowIce
it doesnt even WARRANT

isolating the code.

all's i need to know is how to hide the 1st object, and switch to the 2nd and 3rd.

etc.

that's IT.

NOTHING else.
Sun, 23 May 2010, 13:40
shroom_monk
Well, I don't much about the commands of Blitz3D, but isn't there a help file in B3D? I'm pretty sure that lists all the commands in the language, including the command for hiding objects.

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Sun, 23 May 2010, 13:49
ShadowIce
i know how to hide it and show it.

i just don't know

how to switch between them.
Sun, 23 May 2010, 15:47
bram32
Hide the first one and show the second one. Then later on, show the second one and hide the first one.
Tue, 25 May 2010, 12:43
ShadowIce
i'm close, but still don't get it..



Ignore the needed models, and just look at the code plz.

If the code is fixed, then the models work.
Page : 1 2 Next 3
Prev