Raised This Month: $13 Target: $400
 3% 

Half-Life CD Player. Plays mp3's from ../valve/media directory.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-27-2020 , 12:13   Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #1

This snip loops tracks from Valve's media directory. Github link below. The source is from 1996 Quake.

Code:
emessage_begin(MSG_ONE,SVC_CDTRACK,{0,0,0},id);ewrite_byte(iTrack);ewrite_byte(Loop);emessage_end();
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2020-05-29 Half-Life 1 Engine Messages - AlliedModders Wiki.png
Views:	26
Size:	20.5 KB
ID:	181749  
Attached Files
File Type: sma Get Plugin or Get Source (playonconnect.sma - 32 views - 362 Bytes)
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 05-29-2020 at 16:04. Reason: Simple clarification.
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-27-2020 , 14:19   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #2

Quote:
Change MSG_BROADCAST to a 0
Again with your nonsense?

What is even the point of this thread? You have [small] tags in the .sma file?

If you're so worried about pico-optimizations, why did you create two variables when you don't need them?
"else return" is not needed either since the function ends anyways after the "if".

Quote:
All else is unstable.
I'm seriously starting to think that you're some kind of advanced spam bot.
__________________

Last edited by OciXCrom; 05-27-2020 at 14:23.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-28-2020 , 11:16   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #3

Thanks for the critique. Try using MSG_ONE. It's unstable. One thing we missed. Random was starting from 0 instead of 1.

Quote:
Originally Posted by OciXCrom View Post
Again with your nonsense?

What is even the point of this thread? You have [small] tags in the .sma file?

If you're so worried about pico-optimizations, why did you create two variables when you don't need them?
"else return" is not needed either since the function ends anyways after the "if".



I'm seriously starting to think that you're some kind of advanced spam bot.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 05-28-2020 at 11:27.
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-28-2020 , 13:57   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #4

Quote:
Originally Posted by DJEarthQuake View Post
Thanks for the critique. Try using MSG_ONE. It's unstable. One thing we missed. Random was starting from 0 instead of 1.
Who mentioned anything about MSG_ONE? Your code uses MSG_BROADCAST which is 0 and you're suggesting us to change it to 0.
Why even post something and tell people to change it rather than doing the changes in the post itself?
What is the point of changing 0 to 0?!

None of your comments in this forum make any sense to me.
__________________

Last edited by OciXCrom; 05-28-2020 at 13:57.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-28-2020 , 21:05   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #5

Stable msg_one example posted. Hope you have a better day.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 05-29-2020 at 01:31.
DJEarthQuake is offline
thEsp
Veteran Member
Join Date: Aug 2017
Location: Land of Eagles
Old 05-29-2020 , 05:45   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #6

Quote:
Originally Posted by DJEarthQuake View Post
Stable msg_one example posted. Hope you have a better day.
Excellent replying choice of a wise man.

:)

Last edited by thEsp; 05-29-2020 at 05:48.
thEsp is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-29-2020 , 07:05   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #7

Quote:
Originally Posted by DJEarthQuake View Post
Stable msg_one example posted. Hope you have a better day.
I can't find any MSG_ONE reference in your post or sma file.
I'm totally confused.
__________________
HamletEagle is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-29-2020 , 11:03   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #8

Read the post again please. It's there.
Quote:
emessage_begin(MSG_ONE,SVC_CDTRACK,{0,0,0},id )
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-29-2020 , 15:02   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #9

Quote:
Originally Posted by HamletEagle View Post
I can't find any MSG_ONE reference in your post or sma file.
I'm totally confused.
The post suffered many edits between each of his comments. The original post was even more confusing.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-29-2020 , 15:57   Re: Half-Life CD Player. Plays mp3's from ../valve/media directory.
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
Who mentioned anything about MSG_ONE? Your code uses MSG_BROADCAST which is 0 and you're suggesting us to change it to 0.
Why even post something and tell people to change it rather than doing the changes in the post itself?
What is the point of changing 0 to 0?!

None of your comments in this forum make any sense to me.
First of all I have never pushed hard-coding.
Second the intent of the comment was to warn about crashing when changing Destination types for message_begin. Post has been 'updated'.

Third, people do update their posts.
Quote:
Originally Posted by OciXCrom View Post
The post suffered many edits between each of his comments. The original post was even more confusing.
You told me to do that then act like I have no right to or frown upon it. You can't have it both ways.
Quote:
"Why even post something and tell people to change it rather than doing the changes in the post itself?"
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

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 -4. The time now is 05:16.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode