| Murmur  Apprentice
 
  
   Posts: 33
 Likes Given: 3
 Likes Received: 2 in 2 posts
 Joined: Feb 2013
 Reputation: 0
 
 
 
 ![]() 
 | 
			| Calling functions from my player event file: Performance 
 
				So I created a custom @HitTry code, it's pretty long, probably 200 lines of code, just a bunch of IF statements. The code works great. I have it set up so that if I have 200 dex, I swing weapons like a madman, like 5-10 hits per second.
 Then I need to work on another part of @HitTry (my chance to hit regarding Tactics skill) and I put all my code for my swingspeed into a FUNCTION, and went ahead and tested it before I started coding anything more, and I found that instead of swinging like 5-10 times a second, I swing like 1 time a second.
 
 So my question is about performance using functions, is there any reason that the exact same code being called from a FUNCTION would run slower that if it wasn't in function?
 
 I would never have guessed it would, anyone have any ideas?
 
 Thanks,
 -Murmur
 *you glance to your left to a region you just surveyed... you glimpse a magical being, more shadow than substance, caught midway in transformation... the figure smiles, the corners of his mouth jut upwards slightly on the edges, suddenly stretched to a length not at all human...*
 
				
(This post was last modified: 05-08-2017 08:42 AM by Murmur.)
 |  | 
	| 05-08-2017 08:41 AM |  | 
	
	| ![[+]](images/collapse_collapsed.gif)  
 |