• Welcome to Dark Bit Factory & Gravity.
 

Re: Hello everyone :)

Started by bikerboy, December 01, 2008

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DrewPee

I have fixed the scroller . . .


Screenres 640,480,32,2
Dim as any ptr MyImage
MyImage = imageCreate(640, 480)
Bload "snow.bmp", MyImage
dim buffer as integer
dim a as string
dim xText as double

xText=632:buffer=1

a="Hello guys !! ... thank you for everything !! .... your help is priceless !! couldn't have done what you see before you without you guys :) ... "
a=a+"                                                                                                                                              "

Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-2
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)
sleep


:)

Andy
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

bikerboy

respect guys to all of you :cheers: :cheers:

i only have 2 questions left and this project is finished thanx to all of you ;D

1: how do i make the scroller restart?
2: how do i add a tune?


DrewPee

The scroller (using my code) will restart.
Music I will hand over to somebody else . . . :)

DrewPee
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

hellfire

Challenge Trophies Won:

bikerboy

@ DrewPee

1: how do i make the scroller restart? discard this one i left in a hurry and noticed it afterwards :P thanx again man ;D

@ hellfire

yes i've read this thread, my question should of been like if there is a way to put music like i did with the Bload command.


hellfire

what fileformat do you want to play?
Challenge Trophies Won:

bikerboy

um well the fileformat is not a problem, i mean i can convert it to the one that the command supports if there is such a command.


Rbz

If you are using uFmod, you can use this command to load your .xm song:

hWave = uFMOD_PlaySong(@"your_song.xm",0,XM_FILE)


Below you can find a modified version of uFmod test file:


ChDir ExePath

'Includes
#include "windows.bi"
#include "ufmod.bi"

'Variables
Dim hWave As HWAVEOUT
Dim title_ptr as zstring ptr

'Allocate 50 bytes for music title
title_ptr = allocate(50)


'----------------Main

    'Play our music
    hWave = uFMOD_PlaySong(@"Jos-Chpk.xm",0,XM_FILE)
   
    'Get music title
    title_ptr = uFMOD_GetTitle()

    'Set music volume
    uFMOD_SetVolume(60)
   
    cls
    print "Playing ... "; *title_ptr

    While Inkey$() <> Chr$(27)
       
        Locate 3,1
        Print "                            "
        Print "Time: "; uFMOD_GetTime()
        Sleep 500
       
    Wend
   
    uFMOD_StopSong()

'----------------End

Challenge Trophies Won:

bikerboy

#48
thanx rbz :D i'll try and find a decent xm tune to load :cheers:

EDIT: found the xm tune :clap: , i'll go now play with uFmod :stirrer:

EDIT2: i tried to follow the instructions of Shockwave found here ->http://www.dbfinteractive.com/forum/index.php/topic,542.0.html

but i get this


Compiler output:
C:/Program Files/FreeBASIC/xmas.bas(2) error 136: Default types or suffixes are only valid in -lang deprecated or fblite or qb, found '.' in 'dim shared XmasAmiga.xm(0 to 162993) as ubyte = { _'
C:/Program Files/FreeBASIC/FBIDETEMP.bas(8) error 41: Variable not declared, Music in 'hWave = uFMOD_PlaySong(@Music(1),50600,XM_MEMORY)'
C:/Program Files/FreeBASIC/FBIDETEMP.bas(8) warning 12(0): Implicit variable allocation, Music

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 0.20.0 (08-10-2008) for win32 (target:win32)
OS:    Windows XP (build 2600, Service Pack 3)


the code i use is this

QuoteScreenres 640,480,32,2

#Include Once "tinyptc.bi"
#include "windows.bi"
#include "ufmod.bi"
#include "xmas.bas"
       Dim hWave As HWAVEOUT
       hWave = uFMOD_PlaySong(@Music(0),50600,XM_MEMORY)

Dim as any ptr MyImage
MyImage = imageCreate(640, 480)
Bload "snow.bmp", MyImage
dim buffer as integer
dim a as string
dim xText as double

xText=632:buffer=1

a="scroller text "
a=a+"                                                "
       
Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-1
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)

sleep

i think i should follow his suggestion too :-\

Quote from: Shockwave on August 13, 2006
If you can't figure out how to include ufmod after reading this tut you probably shouldn't be coding.


Shockwave

Quotei think i should follow his suggestion too  :-\

Quote from: Shockwave on August 13, 2006
If you can't figure out how to include ufmod after reading this tut you probably shouldn't be coding.

Programming throws these problems at you, it's up to you as a coder to work them out, I've seen some promising people quit.

By the way, the problem is that the tutorial is for freebasic 1.5

You have a newer version I am guessing, thats why it on't compile without lang deprecated.

So in a nice way I would ask you to stop threatening to give up, you'll get no sympathy that way, instead post your question and don't feel bad about it!

We're happy to help.
Shockwave ^ Codigos
Challenge Trophies Won:

bikerboy

Quote from: Shockwave on December 06, 2008
Programming throws these problems at you, it's up to you as a coder to work them out, I've seen some promising people quit.

By the way, the problem is that the tutorial is for freebasic 1.5

You have a newer version I am guessing, thats why it on't compile without lang deprecated.

yes i have
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 0.20.0 (08-10-2008) for win32 (target:win32)


Quote from: Shockwave on December 06, 2008
So in a nice way I would ask you to stop threatening to give up, you'll get no sympathy that way, instead post your question and don't feel bad about it!

We're happy to help.

you misunderstood me mate, i wrote that b/c whatever i do ends up in error, and i feel like a total idiot if ask for everything i do b/c i can't do anything on my own.

i'm not looking for sympathy , i just don't want to bust your b@lls with questions.

i know you guys are happy to help :)

ok so in the version i have how do i load an mp3 file or an xm file or a mod file?

the easiest way ::)


Rbz

Looking at error message you got, you need to change your "xmas.bas" file:

Replace this line:
dim shared XmasAmiga.xm(0 to 162993)
to:
dim shared Music(0 to 162993)

and also on your main .bas file, change this line:
hWave = uFMOD_PlaySong(@Music(0),50601,XM_MEMORY)
to:
hWave = uFMOD_PlaySong(@Music(0),162994,XM_MEMORY)

It should work now...
Challenge Trophies Won:

bikerboy

ok changed what you said and now i get ->

Compiler output:
C:\Program Files\FreeBASIC\FBIDETEMP.o:fake:(.text+0x4d): undefined reference to `uFMOD_PlaySong@12'



the beginning of the xmas.bas


'// Created with Bin2Bas V0.22 - by Rbraz (c) 2006
dim shared Music(0 to 162993) as ubyte = { _
&H58,&H6D,&H61,&H73,&H41,&H6D,&H69,&H67,&H61,&H00


and the code

Screenres 640,480,32,2

#Include Once "tinyptc.bi"
#include "windows.bi"
#include "ufmod.bi"
#include "xmas.bas"
       Dim hWave As HWAVEOUT
       hWave = uFMOD_PlaySong(@Music(0),162994,XM_MEMORY)

Dim as any ptr MyImage
MyImage = imageCreate(640, 480)
Bload "snow.bmp", MyImage
dim buffer as integer
dim a as string
dim xText as double

xText=632:buffer=1

a="scroller text "
a=a+"                                                "
       
Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-1
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)

sleep


Rbz

#53
Ok, now you have to compile your .bas file with ufmod.o  (object file)

1 - You need to have "ufmod.o" file on same folder of your intro.

2 - Create a .bat file (eg. Compile.bat) and type this line and save:
C:\Program Files\FreeBASIC\fbc -s console ufmod.o your_intro_name.bas
Btw, I'm guessing that your freebasic is installed on this path C:\Program Files\FreeBASIC\ if not just add the correct path.

your_intro_name.bas = your main .bas file

3 - Now, execute your .bat file, it should compile your intro.



Challenge Trophies Won:

bikerboy

no i didn't have that one in the code ,where should i put it in the code?

if xText<(-len(a)*Cool) then xText=632
Loop until xText<((-len(a)*Cool-16))


Rbz

Oh, Ok, it's an 8  :)

The correct is:
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)

Challenge Trophies Won:

bikerboy

* bikerboy is confused ::)

i allready have that in the code

Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-1
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)


Rbz

Ok mate, that part of code is OK now

Now, just compile it using that method of my previous post
Challenge Trophies Won:

bikerboy

#58
but it gives me this error

Compiler output:
C:\Program Files\FreeBASIC\FBIDETEMP.o:fake:(.text+0x4d): undefined reference to `uFMOD_PlaySong@12'


full code i'm using

Screenres 640,480,32,2

#Include Once "tinyptc.bi"
#include "windows.bi"
#include "ufmod.bi"
#include "xmas.bas"
       Dim hWave As HWAVEOUT
       hWave = uFMOD_PlaySong(@Music(0),162994,XM_MEMORY)


Dim as any ptr MyImage
MyImage = imageCreate(640, 480)
Bload "snow.bmp", MyImage
dim buffer as integer
dim a as string
dim xText as double

xText=632:buffer=1

a="scroller text "
a=a+"                                                "
       
Do
    ScreenSync         
    ScreenSet buffer, buffer xor 1
    cls
    Put (0,0),MyImage
    Draw String(xText,470),a
    xText=xText-1
    buffer= buffer xor 1
    if xText<(-len(a)*8) then xText=632
Loop until xText<((-len(a)*8)-16)

sleep


the start from the xmas.bas

'// Created with Bin2Bas V0.22 - by Rbraz (c) 2006
dim shared Music(0 to 162993) as ubyte = { _
&H58,&H6D,&H61,&H73,&H41,&H6D,&H69,&H67,&H61,


EDIT: i have attached the files i'm using if it helps :)


Rbz

Fixed, check the attached file below.

In the rar archive you will find a file called "Compile.bat" execute it to compile your intro with ufmod object file, you need this because fbide doesn't have a good way to do it.
Another problem that I found was with your xmas song, somehow it wasn't in fasttracker format, I just converted it to proper (.xm) format using "MOD2XM.EXE" that you can find on this site somewhere.

Also, I changed this line:
Loop until xText<((-len(a)*8)-16)
to:
Loop until Inkey$() = Chr$(27)
Which stop your intro when user press Escape key


Challenge Trophies Won: