Mod Support?

Linux specific forum
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Mod Support?

Post by Brujah »

I remember having asked this question a while ago.
Will it or is it possible to play modules with purebasic?

The Blitzbasic Version of our game uses Modules for creating a bit of atmosphere.
Can I acomplish this with purebasic too?
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

The mod library for pb says windows only in the help, but i seem to remember asking before aboutt hat and was told it does work in linux? Maybe someone else can confirm this?
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yes, it's possible. You have to download the 'Module' lib for linux here (and check the MIDAS license) : http://www.purebasic.com/download.php3
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post by Brujah »

I did exactly what I read in the Dodumentation.
Thats my code:

Code: Select all

If InitSound() = 0
EndIf

If InitModule() = 0
EndIf

egal = loadmodule(1,"laby/sounds/archonsoflight.mod")
playmodule(1)

delay(5000)
And that what I get as response:
Error: Line 4 - InitModule(): Incorrect number of of parameters.
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

The linux version is quite old, so you will have to put the max number of modules in the InitModule() function like: InitModule(20) ; Max 21 modules, from 0 to 20. Also #PB_Any, aren't supported (shouldn't be a problem for this lib).
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post by Brujah »

I tried to kill artsd before running it. But I still hear nothing.
Does anybody know what I could do?
Last edited by Brujah on Sat Oct 08, 2005 2:41 am, edited 1 time in total.
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post by Brujah »

I tried around a bit but I still cannot get it working.
This is what I try:

Code: Select all

If InitSound() = 0
   print("Sound Error!!")
   end
EndIf

If InitModule(1) = 0
   print("Module Error!!")
   end
EndIf

egal = loadmodule(0,"/home/markus/laby/sounds/archonsoflight.mod")
playmodule(0)

print("playing...")

repeat
   examinekeyboard()
until KeyboardPushed(#PB_Key_Return)

end
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post by Brujah »

Maybe the error lies in the location of the libmidas.a?
The documentation in midas is a bit weird here.
For linking with programs they give you examples for c and delphi.
But I still have no idea about purebasic.
Placing it in the same directory as my program does not work.
Where to place it? Do I have to do something else?
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

You theorically don't need the .a if you use the linux module library.
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Post by Brujah »

I placed the library "module" in the userlibraries directory. In /usr/share/purebasic.
But it is not working, my program crashes when I call initmodule(1).

Can anybody try if it is working on your machines?

Is it a problem of suse? Or my sound configuration?

Really confused...
Post Reply