Note: This forum is merely an archive. It is no longer possible to register or post. - StackOverflow
New Ace of Spades Forums: http://buildandshoot.com/

Squad.py modification

For all your hosting needs.

Squad.py modification

Postby Gorman » Thu Dec 29, 2011 12:04 pm

Well we all know the well known bug where a player spawning on the location of a player will;
1) Appear 2 blocks higher than needed (it could be only 1 block change necessary but I think thats right)
2) Become stuck in a block if there is blocks above the target player (primary caused by spawning on a crouched player)

This can be fixed very simiply with some modifications to line 245
http://code.google.com/p/pyspades/sourc ... uad.py#245

Something like this will fix the first problem;
Code: Select all
spawnLoc = self.get_follow_location(random.choice(live_members))
spawnLoc.z+=2 # Move the player down 2 blocks to the proper location
self.set_location(spawnLoc)

(even better would be to wait for the player's position data to be updated from the client and to spawn on that exact location, but that is a lot more work and a bit unnecessary huh)

For the second problem you would need to set the player's animation to crouched.
Don't exactly know how to do that, but I know you need to send an animation packet with firstByte >> 6 == 1.
I'll leave that to the experts ;)


Anyway this fix is quick and I hope you can implement it!
Image
User avatar
Gorman
[LDR] Member
 
Posts: 1170
Joined: Sat Dec 10, 2011 9:10 pm

Re: Squad.py modification

Postby Dany0 » Mon Jan 02, 2012 4:35 pm

Make it in an if clause, to check if it's actually needed(if there are any blocks over the spawn)
Image
User avatar
Dany0
Member
 
Posts: 358
Joined: Mon Dec 26, 2011 7:29 pm

Re: Squad.py modification

Postby Gorman » Mon Jan 02, 2012 4:41 pm

Dany0 wrote:Make it in an if clause, to check if it's actually needed(if there are any blocks over the spawn)

No point, it would litterally last an instant so it would take more processing and such to put a conditional in for no real gain.

especially since the conditional would have to be complex to allow for situations like spawning on trapped players etc.
Image
User avatar
Gorman
[LDR] Member
 
Posts: 1170
Joined: Sat Dec 10, 2011 9:10 pm

Re: Squad.py modification

Postby Triplefox » Wed Feb 08, 2012 11:23 am

I checked in a fix for this. It checks up to 5 blocks in all directions, and also makes sure you are on ground and not falling. It actually took a lot less time and pain than I expected to get it right.
pyspades contributor, sometimes mapmaker, @ player, indie dev
follow my twitter or yt: @triplefox - sctriplefox
Triplefox
Site Admin
 
Posts: 29
Joined: Sat Dec 10, 2011 10:54 am
Location: s f

Re: Squad.py modification

Postby Gorman » Sun Feb 12, 2012 2:11 pm

Good work!
Image
User avatar
Gorman
[LDR] Member
 
Posts: 1170
Joined: Sat Dec 10, 2011 9:10 pm

Re: Squad.py modification

Postby MrHaaaaaaxFF » Tue Feb 28, 2012 12:06 pm

good job Triplefox, while playing on ldrship server i dont get squad spawn issue anymore!
YAY!
TRIPLEFOX FTW
Image
Here's a touchin' story for ya: Once upon a time, you died and i live forever happily ever after. The end. Now go to hell.
User avatar
MrHaaaaaaxFF
[FF] Leader
 
Posts: 2055
Joined: Mon Jan 23, 2012 11:28 am
Location: Tellin' a touchin' story, description, AoS forums. Also, Vietnam.

Re: Squad.py modification

Postby Yoshii1999 » Tue Feb 28, 2012 5:03 pm

can you post how its now should look? i added it into 245 but doesnt worked.
User avatar
Yoshii1999
Member
 
Posts: 24
Joined: Tue Feb 07, 2012 3:54 pm
Location: Germany

Re: Squad.py modification

Postby Nanners » Tue Feb 28, 2012 10:54 pm

Good job TripleFox ;)!
* USAB ([email protected]) has joined #AoS
* Q sets mode: +v USAB
<+ReubenMcHawk> omg USAB you quit the BOOYO clan?
<+USAB> wat
* USAB is now known as USABxBOOYO
Nanners
[LDR] Member
 
Posts: 526
Joined: Thu Jan 05, 2012 2:12 am


Return to Server



Who is online

Users browsing this forum: No registered users and 5 guests

cron