Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Collision problem

  1. #1
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts

    Collision problem

    Hi all,

    I made some blocks that people dont go outside. When the collission of players is enabled (they cant go through each other, the block is working). When its disable, players can also go through this block and it doesnt block anymore.
    Code:
    naarbuiten1()
    {
    	origin=(-1277,-16209,58);
    	col1  = spawn("script_origin", origin);
          	col1 setcontents(1);
          	col1 solid();
    }
    How to fix it?

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    try setcontents(257)
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Not working

  4. #4
    Private First Class thOuMta's Avatar
    Join Date
    Oct 2012
    Location
    France
    Posts
    191
    Thanks
    139
    Thanked 35 Times in 28 Posts
    PHP Code:
    collision()
    {
        while(
    isAlive(self))
        {
            
    self setContents(256);    
            
    wait 0.05;
        }

    call on spawnPlayer()

  5. #5
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    The disablecollission is working Thoumta, but that makes it that players can go to some solid object. This shouldnt be the case.
    @izno i used the setcontents(257) in the script above and not on the players. Is this correct?

  6. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Players should have setcontents(256) maybe 257
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  7. The Following User Says Thank You to IzNoGoD For This Useful Post:

    thOuMta (8th February 2016)

  8. #7
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Quote Originally Posted by IzNoGoD View Post
    Players should have setcontents(256) maybe 257
    I still dont get it.

    In main() I add
    Code:
    disableGlobalPlayerCollision();
    This works, players can go through each other now. Do I have to add something else?

  9. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Well, disableglobalplayercollision() is kinda bad as it disables basically ALL collision. Would be nice to have a per-player collision (yes/no) thingy
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  10. #9
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    But what happens if 1 player has no collision and the other has it? Can they move through each other? And for bullettrace you must set it to 257 right? What happens if they are in each other and u enable collision?

  11. #10
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    After using this
    Code:
    collision()
    {
        while(isAlive(self))
        {
            self setContents(257);    
            wait 0.05;
        }
    }
    and 256 instead of 257, i can still walk through that "block"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •