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

Entities inputs\outputs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lolz123
Member
Join Date: Aug 2010
Old 01-17-2018 , 12:10   Entities inputs\outputs
Reply With Quote #1

PHP Code:
HookSingleEntityOutput(entity"OnUser1"OnGrenadeThink);

SetVariantString("OnUser2 !self:FireUser1::0.5:-1");

AcceptEntityInput(entity"AddOutput");
AcceptEntityInput(entity"FireUser2"); 
I'm using this in order to create a 0.5 timer, and on OnGrenadeThink I'm creating a particle and re-firing user2 so it repeats until the entity dies.

For some reason sometimes I get this error:
PHP Code:
[SMException reportedNot enough space on the stack
[SMCall stack trace:
[
SM]   [1Line 421D:\test.sp::OnGrenadeThink
[SM]   [3AcceptEntityInput 
The last 2 lines are repeating for ~850 times which is flooding my error log until the server crashes.
What causes the problem? Thanks!
Lolz123 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 01-17-2018 , 13:06   Re: Entities inputs\outputs
Reply With Quote #2

You would have to show more code, but the error means you are probably causing infinite recursion.
Fyren is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-17-2018 , 13:21   Re: Entities inputs\outputs
Reply With Quote #3

It is a lot saner to use an actual timer rather than (ab)using entity outputs, you can use entity references to make sure the timer dies alongside it's associated entity.
__________________
asherkin is offline
Lolz123
Member
Join Date: Aug 2010
Old 01-17-2018 , 15:31   Re: Entities inputs\outputs
Reply With Quote #4

Quote:
Originally Posted by asherkin View Post
It is a lot saner to use an actual timer rather than (ab)using entity outputs, you can use entity references to make sure the timer dies alongside it's associated entity.
Then I'll just change it to use a normal timer and I believe the problem will be solved.
Didn't knew it's better to use an actual timer, but if you say so I doubled the reward.
But what if I create lots of entities with a timer for each one, will it still be better to use a timer and not entity outputs?
Are entity outputs less effective?

Thanks
Lolz123 is offline
Lolz123
Member
Join Date: Aug 2010
Old 01-17-2018 , 15:44   Re: Entities inputs\outputs
Reply With Quote #5

Also, is there a better way to restart an "info_particle_system" entity instead of killing it and creating it again, so it'll repeat after the effect ends?
Like an input or something that can do that.

Thanks

Last edited by Lolz123; 01-17-2018 at 16:12.
Lolz123 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 09:30.


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