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.

DarkBASIC Discussion / Some night problems...

Author
Message
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 21st Dec 2003 03:47
I've decided to do not participate in the AlienWare Compo, because I have too much to do and too little time to do it, so I've decided to make a tank game. Anyway good luck to you all!!!

The game looks fantastic, but in the night atmosphere... Here's the ambient code:

***Code starts here***
backdrop on
rem it's the same if I use 0 and rgb(0,0,0)
color backdrop rgb(0,0,0)
color ambient light 32
set ambient light 75

rem ***The fog***

fog on
fog distance 8000
fog color rgb(8,8,8)

***Code finished***


All right, the atmosphere is all set up and I have my night atmosphere, but when my smoke sprites dissappear...:


***FUNCTION MAKE SMOKE***

Function MakeSmoke(x#,y#,z#,Size#,Speed#)
for t=0 to 90
if object exist(t+1000)=0 then u=t : exit
next t
Make object plain u+1000,Size#,Size#
Texture object u+1000,1000
set object to camera orientation u+1000

rem I think the problem is here
set object u+1000,1,0,1,1,0,0,1

position object u+1000,x#,y#,z#
SmokeLife(u)=50
SmokeSpeed#(u)=Speed#

EndFunction

***END OF FUNCTION***

Ok, my smoke gets created and does what smokes do . Here's the updating code

***UPDATING SECTION OF THE SMOKE***

SmokeLife(t)=SmokeLife(t)-1
if SmokeLife(t)<=30 and object exist(t+1000) then texture object t+1000,1001
if SmokeLife(t)<=15 and object exist(t+1000) then ghost object on t+1000
if SmokeLife(t)<=0 and object exist(t+1000) then delete object t+1000

***END OF THE UPDATING SECTION***

So, what happens?, well, my smoke objects are colored with blue, like if there was a blue light or if the object is fading to the traditional blue background (the background of most of the tutorials), and I don't know what to do, i've tried putting the "color backdrop" instruction in a loop, changing the values of the "set object" instruction.....everything!.

To say it simply..¿How I make a fullbright object for the day atmosphere and how do I make a medium-bright object for the night atmosphere but WITHOUT affecting it with that blue light?

Forgive my "code sections" but I don't know how to put a code snippet, I fear that the format of my post will be changed in a way thatr I don't want i'll try to learn how to use it

Please help me . Thanks in advance

I'm a newbie
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 22nd Dec 2003 21:51
I dont understand your problem 100% but you tried everything huh? Here's a very wierd solution that might works(not sure, just try)

Instead of the array u use the Object Interpolation value of the smoke to store the Smokelife value in (yes, it sounds completely stupid i know!!!). It should work like this



rem Because obj interpolation cannot be < than 0 use - 1 to reach 0

Smokelife=object interpolation(t+1000)
if SmokeLife<=30 and object exist(t+1000) then texture object t+1000,1001
if SmokeLife<=15 and object exist(t+1000) then ghost object on t+1000
if SmokeLife<=0 and object exist(t+1000) then delete object t+1000



you should put it all into a For..Next loop but i think you've already done that

Juzt a dude who likez progging
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 22nd Dec 2003 21:54
Damn! I forgot some code! here is it:

...code from upper message...

set object interpolation t+1000,object interpolation(t+1000)-1

this updates the lifetime

Juzt a dude who likez progging
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 23rd Dec 2003 05:05
Thanks Sjackie for your help....you didn't resolved my problem but you showed me how to optimize that part of code and the use of the Object Interpolation instruction, thanks

But my smokes are in blue...

I'm a newbie
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 26th Dec 2003 19:52
there's no possible way to make a fullbright object then?? or at least to change that "blue light"... I use color backdrop 0 or backdrop off and it's the same

I'm a newbie
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 27th Dec 2003 04:14
go click on the edit button under your avatar,Joined:,Location: and put all that code in the code tags
(
[/code])

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 27th Dec 2003 04:15
wow, that was quite interesting...i managed to get a code box under my signature...
the code flags are [*code]and [*/code] without the stars

Login to post a reply

Server time is: 2025-05-22 08:32:46
Your offset time is: 2025-05-22 08:32:46