Raised This Month: $51 Target: $400
 12% 

Solved "instanced_scripted_scene" and some odd returns


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Scag
AlliedModders Donor
Join Date: May 2017
Location: Crashing Hale
Old 02-25-2018 , 01:31   "instanced_scripted_scene" and some odd returns
Reply With Quote #1

So I was working with a forward to play music during gameplay with a sub-plugin. But I've run into a bit of a wall. I've consistantly got this error:

Which also spewed "instanced_scripted_scene" occasionally

I've got a repeating timer that does some stuff but also checks to see if music is playing. If no music is playing, then it it fires some functions to see if any exist. Shown below:
Spoiler


ManageMusic() works through variables to see which song to play...
Spoiler

To the forward...
Spoiler


Song was either that question mark symbol or "instanced_scripted_scene". ALWAYS returned -1.0. ALWAYS returned something other than Plugin_Handled.
I also tried it with void/ET_Ignore but got the same issue. I genuinely dunno.
For now I just cheesed it to where if time is -1.0 the entire _MusicPlay() function just returns.
__________________
Over-engineering is underrated.

GitHub
BTC
ETH

Retired

Last edited by Scag; 02-26-2018 at 22:11.
Scag is offline
Scag
AlliedModders Donor
Join Date: May 2017
Location: Crashing Hale
Old 02-26-2018 , 22:10   Re: "instanced_scripted_scene" and some odd returns
Reply With Quote #2

I managed to solve it myself. Fortunately it only took about an hour of trial and error.
To the forward function...
PHP Code:
Action Call_OnPlayMusic(char song[PLATFORM_MAX_PATH], float time)
{
    
Action result Plugin_Handled;
    
g_hForwards[OnPlayMusic].Start();
    
Call_PushStringEx(songPLATFORM_MAX_PATHSM_PARAM_STRING_BINARY|SM_PARAM_STRING_UTF8|SM_PARAM_STRING_COPYSM_PARAM_COPYBACK); // Moar flags!
    
Call_PushFloatRef(time);
    
Call_Finish(result);
    
CPrintToChatAll("song = \"%s\"; time = %0.1f; %s"songtimeresult == Plugin_Handled "Handled" "???");
    return 
result;

In case anyone else has this problem, here ya go :^)
__________________
Over-engineering is underrated.

GitHub
BTC
ETH

Retired
Scag is offline
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 -4. The time now is 08:09.


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