Trigger Collisions

Grab your favourite IDE and tinker with the innards of game engines

Trigger Collisions

Postby hekar on Thu Dec 09, 2010 2:18 am

I'm having trouble getting two triggers to collide. Now I know triggers do not collide with each other, so if there is an alternative for my problem then it'd be greatly appreciated.

This mod is a continuation of the officially dead Sourceforts mod.

In Sourceforts the flag is actually a rollermine ball and when dropped becomes physics enabled. Now the player must be able to collide with the flag and trigger a collision, but not actually feel it. The enemy flag should not feel solid to player. To fulfill this requirement, I use game triggers.

The disposer (the disposer removes blocks, players, flags, etc. that touch it) has the same property. The player should collide, but not feel or see the collision.

However, the disposer must also dispose flags!! But they're both triggers! And triggers do not collide with each other.

How do I get the flag and disposer to collide?

Unfortunately, the source code is spread across many files... D:
http://bitbucket.org/hekar/luminous-forts-openbase/src/cbea6eb5295b/diff_patch/src/game/server/Mod/CFlagClassic.cpp
http://bitbucket.org/hekar/luminous-forts-openbase/src/cbea6eb5295b/diff_patch/src/game/server/Mod/CFlagClassic.h
http://bitbucket.org/hekar/luminous-forts-openbase/src/cbea6eb5295b/diff_patch/src/game/server/Mod/CFlagBase.cpp
http://bitbucket.org/hekar/luminous-forts-openbase/src/cbea6eb5295b/diff_patch/src/game/server/Mod/CFlagBase.h
http://bitbucket.org/hekar/luminous-forts-openbase/src/cbea6eb5295b/diff_patch/src/game/server/Mod/CDisposerBase.cpp
http://bitbucket.org/hekar/luminous-forts-openbase/src/cbea6eb5295b/diff_patch/src/game/server/Mod/CDisposerBase.h
http://bitbucket.org/hekar/luminous-forts-openbase/src/cbea6eb5295b/diff_patch/src/game/server/Mod/CDisposerClassic.cpp
http://bitbucket.org/hekar/luminous-forts-openbase/src/cbea6eb5295b/diff_patch/src/game/server/Mod/CDisposerClassic.h
hekar
Dumpling
Dumpling
 
Joined: Thu Dec 09, 2010 2:04 am

Re: Trigger Collisions

Postby Gary on Thu Dec 09, 2010 4:02 am

There is likely a better way, but something I thought that might be easier.

Without coding:
Attach something like npc_bullseye to the flag, when the disposer is trigger by the npc_bullseye, the disposer sets the bullseye's health to 0, when the bullseye dies it fires it's output "Onkilled" to kill the flag trigger.


Though another way, through coding you should be able to make a new entity that does the same but is cheaper, or add an "Onkilled" to other entities or something.

I have a felling I misunderstood the problem though.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Trigger Collisions

Postby hekar on Sat Dec 11, 2010 8:58 pm

OMG, I GOT IT.

phew. Basically inherited from CBaseToggle instead of Trigger overrided the CreateVPhysics, you can see the code once I commit the update.

Thanks for reply though, Gary!
hekar
Dumpling
Dumpling
 
Joined: Thu Dec 09, 2010 2:04 am

Return to Programming

Who is online

Users browsing this forum: No registered users

cron