Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-15-2005, 06:51 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
musicpos and musiclen

i tried play musicname.wav;(real file on server plays right)
and then setplayerprop #c,#v(musiclen(musicname.wav)) but that just showed as 0, so i tried just musiclen but that didn't work either.

so i remain with the question, how do they work?
Reply With Quote
  #2  
Old 03-15-2005, 07:02 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Dunno, never used them. But I would frantically recommend that you use mp3s for music.
__________________
Reply With Quote
  #3  
Old 03-15-2005, 07:37 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
alright kai.
Reply With Quote
  #4  
Old 03-15-2005, 10:40 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
First off, your going to have to convert the seconds into minutes for it to play right. I believe it only works with mp3's.

Anyway, I was working on converting and I converted how long mp3 is, but I can't convert how much were into the song already.

If someone can shorten it, or make it so it shows how much were into the song, I'll be grateful.


NPC Code:

// NPC made by KuJi
if (created) play http://www.graalx.us/downloads/music/Encore/03-eminem-never_enough_(feat_50_cent_and_nate_dogg)_(produce d_by_dr_dre_and_mike_elizondo).mp3;

if (playerchats && strequals(#c,/time)) {
length = musiclen/60;
length2 = strtofloat(#v(int(length)))*60;
length3 = musiclen-length2;
say2 #v(int(musicpos))/#v(int(musiclen)) - #v(int(length)):#v(int(length3));
}




I left the play part in their, cause that's the song i tested it in.
Reply With Quote
  #5  
Old 03-15-2005, 11:36 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by KuJi
strtofloat(#v(int(length)))
Sounds like you learned at the ProjectShifter school of scripting. Why do you use #v and strtofloat here?
__________________
Reply With Quote
  #6  
Old 03-16-2005, 01:51 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Kaimetsu
Sounds like you learned at the ProjectShifter school of scripting.

O.o, PS school of scripting? O.o

Quote:
Why do you use #v and strtofloat here?
You can't int it without
NPC Code:
strtofloat(#v(int(blah)))

I think.
Reply With Quote
  #7  
Old 03-16-2005, 02:14 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by KuJi
O.o, PS school of scripting? O.o
Yes. It is the school where people learn how to script badly.

Quote:
You can't int it without
NPC Code:
strtofloat(#v(int(blah)))

I think.
What purpose do the strtofloat and #v serve in that example? What made you think that you need them?
__________________
Reply With Quote
  #8  
Old 03-16-2005, 02:27 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Kaimetsu
What purpose do the strtofloat and #v serve in that example? What made you think that you need them?
I don't know, I thought that was right. It still works so who cares O.o. Take it off then lol
Reply With Quote
  #9  
Old 03-16-2005, 02:30 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by KuJi
It still works so who cares O.o
Pretty much any competent scripter. The kind that know their tools and combine them to achieve precisely the result they want. The rest of you are just pressing buttons and hoping for the best.
__________________
Reply With Quote
  #10  
Old 03-17-2005, 04:20 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Kaimetsu
Pretty much any competent scripter. The kind that know their tools and combine them to achieve precisely the result they want. The rest of you are just pressing buttons and hoping for the best.

Who cares, just do the other part of the script (Where it displays how much your in the song through min + seconds) :-D
Reply With Quote
  #11  
Old 03-17-2005, 04:23 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by KuJi
Who cares
You ask that question far too often.
__________________
Reply With Quote
  #12  
Old 03-17-2005, 07:12 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by KuJi
strtofloat(#v(int(length)))*60
should just be 'int(length)*60'


PHP Code:
if (created) {
  
play 33.mp3;
  
mlen int(musiclen);
  
timeout .05;
}
if (
timeout) {
  
cpos int(musicpos);
  
left int(musiclen-musicpos);
  
message Total:#v(int(mlen/60))m#v(mlen%60)s
    
Current:#v(int(cpos/60))m#v(cpos%60)s
    
Left:#v(int(left/60))m#v(left%60)s;
  
timeout .05;

newfeatures2002 says it doesn't work on midis, so unless you have a long wav file, I'd recommend using mp3s.

I still hate the CODE tags very much
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #13  
Old 03-17-2005, 07:35 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
it wont work with wavs either i tried.
Reply With Quote
Reply


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


All times are GMT +2. The time now is 06:51 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.