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 / play object after

Author
Message
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 27th Feb 2005 02:43
why if i put play object 30,(my code) after the do wont it play i have to put loop object for it to work but i dont want it loop can i fix this or will i have to work around it

current projects
codename : tasgarad
Random 69
20
Years of Service
User Offline
Joined: 24th Aug 2004
Location: Marshmellowland
Posted: 27th Feb 2005 05:18
becouse it should be like

play object, 30 29,50

where 29 and 50 are the frames you want to play

[ 21.27GB / 74.52GB ] [ 235MB / 511MB ] [ RADEON 9500 PRO / 9700 @ 1280x934 ] [ Windows XP ][ Intel Pentium 4 CPU 2.00GHz @ 1993MHz ]
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 27th Feb 2005 19:08
yer i know i have already put that code thats why i put (my code) i couldnt remember what i put down so i put that, it just stands still(the object) then if i click escape it plays its really annoying

current projects
codename : tasgarad
Random 69
20
Years of Service
User Offline
Joined: 24th Aug 2004
Location: Marshmellowland
Posted: 2nd Mar 2005 11:51
Ok well one proberly which is YOUR PROBLEM i assume is you have your code in the loop so the program thinks

OMG OMG OMG this crazy steve dude wants me to play this crap OK OK im doin it play oh wait it looped play again oh wait loop play again oh crap loop lets start again

messed up method

anywhoo its playing 1 frame and then the next loop hits restarting the loop. To solve this i would start a timer and if the timer isnt past say 5 seconds dont loop it

if timer() < 5 then x = 99
if x = 99 then play object 1, 30 99

i dont no if that helps BTW THATS NOT ACTAUL CODE WONT WORK WORTH A CRAP ITS EXAMPLE CODE THE TIMER ISNT RIGHT AT ALL

[ 21.27GB / 74.52GB ] [ 235MB / 511MB ] [ RADEON 9500 PRO / 9700 @ 1280x934 ] A++ 10% Done [ Windows XP ][ Intel Pentium 4 CPU 2.00GHz @ 1993MHz ]
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 3rd Mar 2005 05:25
lol oh that "crazy steve dude" cracked me up lol anyway i see what u are sayin but i still cant get it to work ive tried everything i can think of need more help pls

current projects
codename : tasgarad
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Mar 2005 06:53
Try this


1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)
Random 69
20
Years of Service
User Offline
Joined: 24th Aug 2004
Location: Marshmellowland
Posted: 4th Mar 2005 01:26
what he said

[ 21.27GB / 74.52GB ] [ 235MB / 511MB ] [ RADEON 9500 PRO / 9700 @ 1280x934 ] A++ 10% Done [ Windows XP ][ Intel Pentium 4 CPU 2.00GHz @ 1993MHz ]
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 8th Mar 2005 02:53
that dont work i cant move or anything then it just freezes while he plays the animation (i put that after the main loop)

current projects = codename : tasgarad
despite what it sais to the left joined 5 december 03
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 9th Mar 2005 13:10 Edited at: 9th Mar 2005 13:13
Loop Object in DBC is brokeded.


Do something like this:


dim LoopedObjs(100,2)
`your main loop
LoopObj(1,9,50)
do
CheckLoops()
loop


Animation looping functions
function LoopObj(obj, st, end)
for i=0 to 100

if LoopedObjs(i,0)=0
LoopedObjs(i,0)=obj
LoopedObjs(i,1)=st
LoopedObjs(i,2)=end
exit
endif

next i

PlayObject obj, st, end
endfunction


function CheckLoops()
for i = 0 to 100
if LoopedObjs(i,0)>0
if object playing(LoopedObjs(i,0))=0 then play object LoopedObjs(i,0), LoopedObjs(i,1), LoopedObjs(i,2)
endif
endif
next i
endfunction


Crazy Donut Productions
Current Project: A Redneck game
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 10th Mar 2005 01:35
cool thanks but how would i put that into this pls

exept the play object doesent work obvioulsy

current projects = codename : tasgarad
despite what it sais to the left joined 5 december 03
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 10th Mar 2005 09:46
Just stick the functions at the bottom below your END statement, put the DIM LoopedObjs(100,2) at the top, and in your main loop area where the statement is, put it as such(I'll assume you're using a DO loop, just for kicks and giggles, it doesn't matter what you use):

DO
rem blah dee blah your code and stuff

if distance#<500 and withinboundaries = 1
LoopObj(30,20,45)
endif

rem more blah dee blah

CheckLoops()
LOOP


Crazy Donut Productions
Current Project: A Redneck game
bibz1st
22
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 12th Mar 2005 18:51
have you tried the obvious...

all you need to do then is reset canplay back to 0 whenever you need to

Login to post a reply

Server time is: 2025-05-23 19:14:10
Your offset time is: 2025-05-23 19:14:10