Raised This Month: $ Target: $400
 0% 

For loop isn't looping?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-04-2007 , 15:25   For loop isn't looping?
Reply With Quote #1

I've been trying to create a plugin for TFC that allows players to walk through each other when they are in distance, and also check to see if there are any entities they need to interact with. The best way so far I found to check if players are near entities was to log the entity origins on their spawn, then check later on.

If the players aren't near each other they stay solid.
If players are near each other they become not solid.
If players are near each other, but also near an interaction entity, they become solid.

In the prethink it seems like the second for loop isn't looping.

I posted the full code here...
http://ampaste.net/19106

Hopefully someone can help me figure this out : /
I'm so confused, and my programming abilities aren't that great still.

Note: Alot of the code is from around the forum.
hlstriker is offline
Old 06-04-2007, 15:52
Ramono
This message has been deleted by Ramono. Reason: doubled
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 06-04-2007 , 15:54   Re: For loop isn't looping?
Reply With Quote #2

Not rly the thread question but: Maybe keep them not solid and use force_touch / force_use
__________________
Um, hi.
Ramono is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-04-2007 , 16:10   Re: For loop isn't looping?
Reply With Quote #3

If I switched to using that I would still have to use the for loop though? Wouldn't I need to check the origins still?
hlstriker is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 06-05-2007 , 01:49   Re: For loop isn't looping?
Reply With Quote #4

FM_Touch can get when two people touch each other with no need for loops or other inefficient methods. There is already a plugin for surfmod or something that allows you to go through players so look for that.
kmal2t is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 06-05-2007 , 07:33   Re: For loop isn't looping?
Reply With Quote #5

I have to say it : NEVER run for loops of 512 in prethink, regardless if it get's executed or not !!!!
This topic (or at least something close to this) was disscussed round here not long ago.
http://forums.alliedmods.net/showthread.php?t=55028
Search is your friend
_Master_ is offline
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 06-05-2007 , 10:01   Re: For loop isn't looping?
Reply With Quote #6

SOLID_TRIGGER /* touch on edge, but not blocking */

sould be able to walk tru, also makes it register touches (not tested)
__________________
Um, hi.
Ramono is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-05-2007 , 13:32   Re: For loop isn't looping?
Reply With Quote #7

Quote:
Originally Posted by kmal2t View Post
FM_Touch can get when two people touch each other with no need for loops or other inefficient methods. There is already a plugin for surfmod or something that allows you to go through players so look for that.
This method doesn't work good at all because you will bump into them for a second then continue through.

Quote:
Originally Posted by _Master_ View Post
I have to say it : NEVER run for loops of 512 in prethink, regardless if it get's executed or not !!!!
This topic (or at least something close to this) was disscussed round here not long ago.
http://forums.alliedmods.net/showthread.php?t=55028
Search is your friend
Yeah I noticed the game was actually a tad choppy while running that with alot of players in the game. Also, I know about the surf plugin, but this is for TFC and it has different things it needs to do.

Quote:
Originally Posted by Ramono View Post
SOLID_TRIGGER /* touch on edge, but not blocking */

sould be able to walk tru, also makes it register touches (not tested)
I will try this. I hope it works, it will be a life saver :O
hlstriker is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-05-2007 , 14:11   Re: For loop isn't looping?
Reply With Quote #8

Making players a solid_trigger blew my game up and gave me the error "trigger in clipping list".
hlstriker is offline
artur22
Junior Member
Join Date: Feb 2008
Old 02-19-2008 , 20:58   Re: For loop isn't looping?
Reply With Quote #9

I have the same problem, please solution?
artur22 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 10:36.


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