View unanswered posts | View active topics It is currently Thu Dec 26, 2024 6:24 pm



Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
 Multiple 'else' in one 'if'? 
Author Message
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Multiple 'else' in one 'if'?
Grif wrote:
self.Frame = 1;
else
self.Frame = 0;


That doesn't seem to work... Well, it did once, but only one way ('self.Frame = 1;' but not 'self.Frame = 0;'), and now it doesn't...
Also, for some unknown reason, everything started laging. Yesterday I tested the door in both singleplayer and 2player mode and it was lagless, today everything is ♥♥♥♥ up. >:E

If this lag doesn't just 'go away', this thing will end up scrapped...
And honestly, I don't even know what causes the lag... It's definitely not the emitters, because the particles they emit are very short lived, so there aren't really more then 50-70 of them per frame... So it must be the checks... Even though there are only 2 working at a time...

I tried changing all the proximity checks to boxes but it didn't seem to reduce lag.
Is there a better way to trigger the lasers without having to constantly check for them?
I tried adding a proximity check that would make 'emitter = self.laser;' and then use 'self.laser' for whatever I needed, but I ended up with that Ω error BS... Maybe I was doing it wrong?

Sometimes, I really ♥♥♥♥ hate how CC works. >:C

This is the current code, I changed the checks to boxes, but self.Frame doesn't work. See what is wrong.


Sat Aug 08, 2009 9:30 pm
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Multiple 'else' in one 'if'?
for one, putting it all in a box that checks positions every 1/3/500 MS using timers should dramatically cut down your lag.
otherwise, your efficiency was pretty bad. http://pastebin.com/m5f9be4e9 enjoy


Sat Aug 08, 2009 10:04 pm
Profile WWW
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Multiple 'else' in one 'if'?
Geti wrote:
for one, putting it all in a box that checks positions every 1/3/500 MS using timers should dramatically cut down your lag.
otherwise, your efficiency was pretty bad. http://pastebin.com/m5f9be4e9 enjoy


Hmm, that does actually remove the lag... 300ms is alot though, I changed it to 80.

Now, a new problem occured. It lags like ♥♥♥♥ whenever an AI actor is on scene.
It seems that AI somehow makes ♥♥♥♥ with lua lag...
And the thing seems to break after some time... Like, it stops switching on/off, it always stays on.

Goddamnit.


Tue Aug 11, 2009 9:55 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Multiple 'else' in one 'if'?
http://pastebin.com/m4f7c94f8
has a link to another pastebin containing something for major restructuring that i cbf doing now. should fix your lag, considering the gross amount of for loops.
heck, you could create a list early on using some string.find and proximity checks for the emitters so you cant get rid of the particle fors.


Tue Aug 11, 2009 11:18 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 19 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.119s | 13 Queries | GZIP : Off ]