Go Back   the Magicball Network > Forums > LBA Projects > Little Script Adventure
Buy LBA1/Relentless from GOG.com Buy LBA1/Relentless from DotEmu Buy LBA2/Twinsen's Odyssey from DotEmu Buy LBA2/Twinsen's Odyssey from GOG.com Buy Little big Adventure from GOG.com or DotEmu Buy Little big Adventure 2 from DotEmu or GOG.com

Welcome to the Magicball Network.

You are currently viewing our site as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Little Script Adventure An open-source 3D engine with assets and tools for all future LBA fan-games.

Reply
 
Thread Tools
  #3751  
Old 2012-07-22, 03:18
Jasiek's Avatar
Jasiek Jasiek is offline
Do the evolution.
 
Join Date: Jul 2003
Location: You forgot Poland.
Posts: 8,093
I modified the platform so it has an engine and a big cog on the bottom, the engine has glowing parts on it. the platform also has a collision shell, as well as the rounded door, not sure about the sewer door yet though.




__________________
Little Script Adventure
Join the Little Script Adventure team
Download Little Script Adventure

Last edited by Jasiek; 2012-07-22 at 14:32.
Reply With Quote
  #3752  
Old 2012-07-23, 08:52
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
I comited
check the captain code in test map to see how to play sounds.
play_sound(a,b)
where a is the object emiting the sound, and b the name of wav/ogg file relative to root folder (for example '"assets/sounds/door_wooden_slide.wav"). As always, set "a" to keyword "this" to have sound emited by object you are editing.

4 other functions
get_anim(object_name)
returns current SMD anim playing
set_anim(object_name)
set anim to play, will setup frame playing to 0
get_frame(object_name)
returns current SMD anim frame
is_anim_finished(object_name)
true if animation last frame is playing
__________________
Little Script Adventure[thread][download]

Last edited by David; 2012-07-23 at 09:00.
Reply With Quote
  #3753  
Old 2012-07-23, 10:08
Jasiek's Avatar
Jasiek Jasiek is offline
Do the evolution.
 
Join Date: Jul 2003
Location: You forgot Poland.
Posts: 8,093
How do I set a sound to a sliding door then?

I tried this and it doesn't seem to work:

if is_at_node()==true then
if get_node()==0 and distance("heroe")<2 and action()==true then
set_node(1) and play_sound(this,"assets/sounds/door_wooden_slide.wav")
elseif get_node()==1 and distance("heroe")>3 then
set_node(0) and play_sound(this,"assets/sounds/door_wooden_slide.wav")
end
end

if has_waited()==true then
move_to_node()
end


That ^ breaks the door...

this doesn't:

if is_at_node()==true then
if get_node()==0 and distance("heroe")<2 and action()==true then
set_node(1)
elseif get_node()==0 and distance("heroe")<2 and action()==true then
play_sound(this,"assets/sounds/door_wooden_slide.wav")
elseif get_node()==1 and distance("heroe")>3 then
set_node(0)
elseif get_node()==1 and distance("heroe")>3 then
play_sound(this,"assets/sounds/door_wooden_slide.wav")
end
end

if has_waited()==true then
move_to_node()
end

but the sound won't play anyway

should we have play_sound and loop_sound btw?
__________________
Little Script Adventure
Join the Little Script Adventure team
Download Little Script Adventure

Last edited by Jasiek; 2012-07-23 at 10:19.
Reply With Quote
  #3754  
Old 2012-07-23, 10:40
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
before anything do you ear the steps of captain in test map ?
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3755  
Old 2012-07-23, 11:55
Jasiek's Avatar
Jasiek Jasiek is offline
Do the evolution.
 
Join Date: Jul 2003
Location: You forgot Poland.
Posts: 8,093
yes
__________________
Little Script Adventure
Join the Little Script Adventure team
Download Little Script Adventure
Reply With Quote
  #3756  
Old 2012-07-23, 13:19
ambient's Avatar
ambient ambient is offline
Magic Level: Red Ball
 
Join Date: Jun 2010
Location: Russia
Posts: 146
Quote:
Originally Posted by Jasiek View Post
How do I set a sound to a sliding door then?
Code:
if is_at_node()==true then
    if get_node()==0 and distance("heroe")<2 and action()==true then
        set_node(1)
        play_sound(this,"assets/sounds/door_wooden_slide.wav")
    elseif get_node()==1 and distance("heroe")>3 then
        set_node(0)
        play_sound(this,"assets/sounds/door_wooden_slide.wav")
    end
end
If you want to execute 2 instructions, just write them sequentially. Using and operator is just plain wrong (though it's probably not the case here).

EDIT: However, since play_sound isn't actually bound to C function, "attempt to call global 'play_sound' (a nil value)" happens. It's up to David to fix it.

EDIT2: Forgot to update. That's no longer a concern.
__________________
Become one with Russia, da?

Last edited by ambient; 2012-07-23 at 14:42.
Reply With Quote
  #3757  
Old 2012-07-23, 17:19
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
yep, you have to separate commands here, and keyword is for conditions.
Quote:
elseif get_node()==1 and distance("heroe")>3 then
set_node(0)
elseif get_node()==1 and distance("heroe")>3 then
play_sound(this,"assets/sounds/door_wooden_slide.wav")
you have same condition 2 times, thus the elseif line will never trigger.

The sewer door has no shell
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3758  
Old 2012-07-23, 19:18
Jasiek's Avatar
Jasiek Jasiek is offline
Do the evolution.
 
Join Date: Jul 2003
Location: You forgot Poland.
Posts: 8,093
I'll update the door then.

Sooooo then how do I write that code for the sound for the door??
__________________
Little Script Adventure
Join the Little Script Adventure team
Download Little Script Adventure
Reply With Quote
  #3759  
Old 2012-07-23, 20:54
ambient's Avatar
ambient ambient is offline
Magic Level: Red Ball
 
Join Date: Jun 2010
Location: Russia
Posts: 146
Quote:
Originally Posted by Jasiek View Post
Sooooo then how do I write that code for the sound for the door??
Erm... Use the code snippet in my previous post? Though I've already added it to the map, check the latest revision
__________________
Become one with Russia, da?
Reply With Quote
  #3760  
Old 2012-07-24, 16:00
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
For the moving platform sound, I think we need some queue features. Just as anims, you could have start, loop, and end sound samples. Then, for the sewer platform going from up node to bottom node, you could send a command that plays the start sample, 5 times the loop sample and finally one time the end sample. All in one command.
Do you have an idea where to find such sound samples ?
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3761  
Old 2012-07-24, 17:44
Horadrim's Avatar
Horadrim Horadrim is offline
Free-lance designer
 
Join Date: May 2004
Location: Bulgaria
Posts: 1,356
Send a message via ICQ to Horadrim
I could make some sound stuff.
Reply With Quote
  #3762  
Old 2012-07-24, 21:07
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
thanks !
For testing purpose I made some, in the sounds folder. The looping is jumping...
I implemented platform sound on test map and sewer map, so you can already see how it works. Depending on platform travel, I add more or less looping parts to the sound. The lua command is this one :
play_sound_queue(object_name,n1,sample1,n2,sample2,...)
sample1 is played n1 times, then sample2 played n2 times, etc... source emitter is following object called object_name (can be keyword this)
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3763  
Old 2012-07-24, 21:53
Horadrim's Avatar
Horadrim Horadrim is offline
Free-lance designer
 
Join Date: May 2004
Location: Bulgaria
Posts: 1,356
Send a message via ICQ to Horadrim
Okay, I made 6 ogg vorbis samples of platform movements (two variations from the start, loop and end sounds). I think that if we use the ogg vorbis format, it`ll be better, because it`s open format after all. If there`s a problem with using ogg files, I`ll resubmit the files in wav format if necessary.
Reply With Quote
  #3764  
Old 2012-07-24, 22:29
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
all samples are playing in test map now.
Samples can be ogg yes, but must be mono not stereo. Because 3D sounds are used, which plays on left, right or both speakers depending where you are in the map. So having stereo is not compatible with such a thing. However stereo is good for music, which doesn't use 3D localisation.
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3765  
Old 2012-07-24, 23:03
Horadrim's Avatar
Horadrim Horadrim is offline
Free-lance designer
 
Join Date: May 2004
Location: Bulgaria
Posts: 1,356
Send a message via ICQ to Horadrim
It`s not a problem to make them mono, just tell me which channel should I use (left or right).
Reply With Quote
  #3766  
Old 2012-07-24, 23:29
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
you can merge them (with audacity for example)
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3767  
Old 2012-07-25, 00:33
Horadrim's Avatar
Horadrim Horadrim is offline
Free-lance designer
 
Join Date: May 2004
Location: Bulgaria
Posts: 1,356
Send a message via ICQ to Horadrim
I`ll merge them then. I`ve got a good program, which I`m using for years .
As for the sounds - the horizontal platform (the one with gears inside, I made for the prison), should use other sounds. These sounds I committed were supposed to be for the platform, Jasiek made.
Reply With Quote
  #3768  
Old 2012-07-25, 12:04
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
OK, will you do the sounds for horizontal platform then ?

I've setup sound "receiver" so that left and right speakers should match heroe left and right ear. However I don't ear sounds going from left to right while heroe rotates around itself.
Do you confirm this ?
In the future, if this is solved, I will try to setup sound receiver based on camera, what do you think ?
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3769  
Old 2012-07-25, 13:05
Horadrim's Avatar
Horadrim Horadrim is offline
Free-lance designer
 
Join Date: May 2004
Location: Bulgaria
Posts: 1,356
Send a message via ICQ to Horadrim
I already made the horizontal platform sounds, but I`m not quite happy with them. I`ll try to make new ones today. If not, I`ll commit the ones I have already, so we could have at least something temporary.

EDIT: I don`t hear anything special with the left/right channels. To me it seems like before.

EDIT2: I committed the new horizontal platform movement sounds. This time mono. Just a quick note - the end movement sound, should be played when the platform stops. When the platform stays at one place (i.e. waiting for Twinsen to jump on it), it shouldn`t make any noise/sounds.

Last edited by Horadrim; 2012-07-25 at 13:46.
Reply With Quote
  #3770  
Old 2012-07-25, 18:30
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
left / right should work now
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3771  
Old 2012-07-25, 20:47
Horadrim's Avatar
Horadrim Horadrim is offline
Free-lance designer
 
Join Date: May 2004
Location: Bulgaria
Posts: 1,356
Send a message via ICQ to Horadrim
Yes, it works now, but something is wrong - i.e. Twinsen is behind the rabbybunny, the camera is behind Twinsen too, but I hear the steps of the bunny in the right. Similar thing happens, when Twinsen is infront (near the horizontal platform) and I hear the steps somewhere at the left, when they should be in the right. Also - the end sound for the platform plays too soon and then the platform moves some distance without sound and stops.
Reply With Quote
  #3772  
Old 2012-07-25, 21:01
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
maybe the editor is not running at 60FPS ? Sound is playing in a separated thread.
For the left/right, you ear what heroe ears (on the version you have). Have you try rotating heroe on hisself ? What happen ?
__________________
Little Script Adventure[thread][download]
Reply With Quote
  #3773  
Old 2012-07-25, 22:14
Horadrim's Avatar
Horadrim Horadrim is offline
Free-lance designer
 
Join Date: May 2004
Location: Bulgaria
Posts: 1,356
Send a message via ICQ to Horadrim
I now tried again and heard that this depends from Twinsen`s position. This would`ve been ok, if we had fixed 3rd person camera, behind him, but we`re using other camera method and this is really confusing. It should be made dependent from the camera, not from Twinsen`s ears position.
Reply With Quote
  #3774  
Old 2012-07-26, 11:17
David's Avatar
David David is offline
Magic Ball Master
 
Join Date: Dec 2008
Location: Barcelona
Posts: 1,685
You now hear what camera hears. left/right pan is noticable only for the low camera in test map. It also plays sound louder, this is logical since you are closer to sound sources.
It seems to me microphone should be closer to heroe, but with the orientation and alignment of camera. Just like in movies they don't put camera and microphone at the same place, microphone is closer to subject. Let me know your feeling about this.
__________________
Little Script Adventure[thread][download]

Last edited by David; 2012-07-26 at 11:38.
Reply With Quote
  #3775  
Old 2012-07-26, 13:08
Horadrim's Avatar
Horadrim Horadrim is offline
Free-lance designer
 
Join Date: May 2004
Location: Bulgaria
Posts: 1,356
Send a message via ICQ to Horadrim
It`s much better now. Btw - back to the case with the platform. The start sound plays before the platform begins it`s movement and the end sound plays before the platform reaches it`s final point. Isn`t the sound bound to the waypoints? I mean - when the platform reaches the end point, the end sound should play and stop. I think that the problem is not from the framerate - I have around 60fps jiggling up in the left (in fact, I can`t determine what the exact framerate is, since the numbers change very rapidly).

EDIT: Okay, the delay with the start of the platform and the start sound comes from the "wait(40)" in the script. Now about the end I suppose the case is similar, but I don`t quite understand the purpose of the numbers between the sound names, so I could try something different with them.

Last edited by Horadrim; 2012-07-26 at 13:14.
Reply With Quote
Reply

Tags
awesome, demo, engine, lba, lba1r, little bigger adventure, little script adventure, non profit, opengl, opensource, tools

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Link on mbn main page Vral The site and forum 19 2005-11-04 05:17
main page Jesse LBA DM 3 2001-04-29 22:12
Why does no one visit the main site? CS2x The site and forum 42 2001-02-01 18:24


All times are GMT +2. The time now is 21:39.




News Feed
Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2016, the Magicball Network