AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   For loop isn't looping? (https://forums.alliedmods.net/showthread.php?t=56016)

hlstriker 06-04-2007 15:25

For loop isn't looping?
 
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.

Ramono 06-04-2007 15:54

Re: For loop isn't looping?
 
Not rly the thread question but: Maybe keep them not solid and use force_touch / force_use

hlstriker 06-04-2007 16:10

Re: For loop isn't looping?
 
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?

kmal2t 06-05-2007 01:49

Re: For loop isn't looping?
 
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.

_Master_ 06-05-2007 07:33

Re: For loop isn't looping?
 
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 :wink:

Ramono 06-05-2007 10:01

Re: For loop isn't looping?
 
SOLID_TRIGGER /* touch on edge, but not blocking */

sould be able to walk tru, also makes it register touches (not tested)

hlstriker 06-05-2007 13:32

Re: For loop isn't looping?
 
Quote:

Originally Posted by kmal2t (Post 485817)
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_ (Post 485889)
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 :wink:

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 (Post 485922)
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 06-05-2007 14:11

Re: For loop isn't looping?
 
Making players a solid_trigger blew my game up and gave me the error "trigger in clipping list".

artur22 02-19-2008 20:58

Re: For loop isn't looping?
 
I have the same problem, please solution?


All times are GMT -4. The time now is 10:36.

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