Garry's Mod
88 คะแนน
[Obsolete] [E2] CollisionCore
   
รางวัล
ชื่นชอบ
ชื่นชอบแล้ว
เลิกชื่นชอบ
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Fun
ขนาดไฟล์
โพสต์
อัปเดต
6.896 KB
21 พ.ค. 2016 @ 6: 30pm
7 ก.ย. 2022 @ 5: 18am
11 หมายเหตุการเปลี่ยนแปลง ( ดู )

สมัครสมาชิกเพื่อดาวน์โหลด
[Obsolete] [E2] CollisionCore

คำอธิบาย
This addon is obsolete! Please use collision functions from base Wiremod instead.

This Expression 2 extension adds functions for collision detection and a new collision data type.

GitHub: https://github.com/CornerPin/e2CollisionCore

List of functions:

Function
Description
runOnCollision(entity ent, number activate)
If set to 1, the chip will run when the specified entity collides with anything.
number=collideClk()
Returns 1 if the chip execution was caused by a collision.
collision=getCollision()
Returns the collision data from the last collision.
entity=xcl:hitEntity()
Returns the other collision entity.
entity=xcl:ourEntity()
Returns the collision entity.
vector=xcl:hitPos()
Returns the collision position.
vector=xcl:ourOldVel()
Returns the entity's velocity before the collision.
vector=xcl:theirOldVel()
Returns the other entity's velocity before the collision.
vector=xcl:ourNewVel()
Returns the entity's velocity after the collision.
vector=xcl:theirNewVel()
Returns the other entity's velocity after the collision.
vector=xcl:ourOldAngularVel()
Returns the entity's angular velocity before the collision.
vector=xcl:theirOldAngularVel()
Returns the other entity's angular velocity before the collision.
vector=xcl:hitNormal()
Returns the normal of the surface that hit the other entity.
vector=xcl:hitSpeed()
Returns the speed at which the impact happened.
number=xcl:delta()
Returns the time since the last collision with the other entity.
number=xcl:speed()
Returns the speed of the entity before the collision.
table=xcl:toTable()
Returns the collision data as a table.
8 ความเห็น
CornerPin  [ผู้สร้าง] 22 ม.ค. 2020 @ 12: 22pm 
This is not a thing you can spawn, the addon extends the functionality of Expression 2 from Wiremod .
jacob 22 ม.ค. 2020 @ 11: 11am 
what kak spawniti collisoncore
:steamsad:
CornerPin  [ผู้สร้าง] 29 ต.ค. 2018 @ 9: 32am 
Do you mean it doesn't detect collisions between two NPCs? Because I can get collisions between NPC and another physical object, that is not an NPC, and I don't think I can fix that, because this is how the Source Engine works.
SegwOo 16 ต.ค. 2017 @ 2: 37am 
ogo like-os
DeadButDesu 21 เม.ย. 2017 @ 1: 05pm 
Thank you!!!!!!!!!!!!!!!!!!!
X-Coder 5 มี.ค. 2017 @ 4: 33pm 
Thank you for the fast fix, its working great now.
CornerPin  [ผู้สร้าง] 3 มี.ค. 2017 @ 3: 10am 
Hi, now i fixed it. Thank you for reporting!
X-Coder 2 มี.ค. 2017 @ 2: 48pm 
Hi, good addon, but I have a little issue:

it works great the first time, but as soon I reload the e2, collision is detected fine and e2 is called, but getCollision table often stays empty and all the functions only returns some defaults, like (0)worldspawn or [NULL entity] for ownEntity and entity function.
Is there somesthing I need to call on reload?

@name CollisionTest
@inputs Ent:entity
@outputs CollisionT:table
@persist
@trigger
if(first() || duped()){
runOnCollision(Ent, 1)
}
if(collideClk()){
Collision=getCollision()
print(Collision:entity()) #--> prints [NULL Entity]
print(Collision:ourEntity()) #--> prints [NULL Entity]
}