Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Need some help with a projectile cog...
Need some help with a projectile cog...
2002-10-05, 3:43 AM #1
Okay, for dark fist, i want to make the projectile cog so that if a bullet hits metal, you hear it hit metal, if it touches wood, you hear it touch wood and see some pieces of wood flying... now, i can make it make metal hitting sound when it hits any surface... i was thinking i'd flag wood surfaces with some unused flag, same with metal etc... but how would i get the flags of the surface the bullet hits? that's what i need help with...

------------------
Cave_Demon, an ***hole since '86
Last edited by mb; today at 10:55 AM.
2002-10-05, 4:25 AM #2
Difficult, this is. In order to do this, you would need to be able to get the 'surface hit'... Not an easy thing to do.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-05, 5:11 AM #3
is there any way to get the surface a thing has attached to? I could make the projectile create a thing that attaches a surface, and so on...

------------------
Cave_Demon, an ***hole since '86
Last edited by mb; today at 10:55 AM.
2002-10-05, 7:30 AM #4
AFAIK, hte only way to know when a specific surface has been hit, is to define it in the symbols section, and use the Damaged message. Quick thinkers will realize, you would have to define EVERY surface in a level. So, unless your level has less than200 surfaces, this isnt at all practical.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-05, 8:47 AM #5
What about making a loop and blablabla check if any surface flagged blablabla has been damaged blablabla [http://forums.massassi.net/html/smile.gif]

------------------
Cave_Demon, an ***hole since '86
Last edited by mb; today at 10:55 AM.
2002-10-05, 10:37 AM #6
Those 'blahblah's contain alot of steps that arent possible. Im sorry, but if it were possible, alot of kookie other stuff would be too.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-05, 4:28 PM #7
Unless of course you wanted to define each texture... and use GetSurfaceMat(surface); ?
Team Battle.
2002-10-05, 4:29 PM #8
Oh I see the prob, whoops! Stupid me.
Team Battle.
2002-10-05, 4:49 PM #9
Lol, that still leaves you with the problem of defining every surface...


What you might consider doing, is placing a transparent 3d0 over the target surfaces. When the object is struc, you have your message...

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-06, 10:17 AM #10
Quote:
<font face="Verdana, Arial" size="2">Originally posted by GBK:
AFAIK, hte only way to know when a specific surface has been hit, is to define it in the symbols section, and use the Damaged message. Quick thinkers will realize, you would have to define EVERY surface in a level. So, unless your level has less than200 surfaces, this isnt at all practical.
</font>

Well, he could make the default explosion be the brick one, so that he only had to define the wooden and metal surfaces...

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

[This message has been edited by zagibu (edited October 06, 2002).]
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-10-06, 10:54 AM #11
Well, if we could find a way to get the closest surface to a position, that might be the key...

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-06, 2:52 PM #12
Cant you get the centre of a face? Using that you could run a loop. And get the one with the smallest distance to the explosion.

I believe the command is GetSurfaceCenter().
Team Battle.
2002-10-06, 3:22 PM #13
Yeah, Getsurfacecenter(), or just plain Surfacecenter()...


The problem with that is, if the target surface is real wide, and there is one right next to it thats real thin, and the shot hits close to the thin surface, the code might return the thin surface...

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-06, 3:59 PM #14
I just got this idea that came into my head, I don't know if this will work though...
Code:
 Touched:
   For(i=0; i<GetSurfaceCount(); i=i+1)
      If(GetSenderRef() == i) then surfacehit = i;

   If(GetSurfaceFlags(surfacehit) == flag)
   {
      PlaySoundPos( The stuff using GetSurfaceCenter() );
      Whatever else you want
   }
Just a thought... *shrug*

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-10-07, 8:42 AM #15
In order for that to work, you would have to declare every surface in the level in the symbols section.

And besides,

Code:
Touched:

If(Getsurfaceflags(Getsenderref()) && flag) {
//do stuff..
}


..would work too. But it wouldnt work, because you cant get messages from undeclared surfaces.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-07, 10:55 AM #16
To find out if one flag includes another, use the bitwise AND operator (&). It will return the bits common to both numbers. The '==' operator will work only when both flags are equal.

But both of you knew that, right? [http://forums.massassi.net/html/tongue.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited October 07, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-10-07, 12:00 PM #17
Yes, that would also be the practical choice. (bitwise)

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-10-07, 2:00 PM #18
Yeah, I knew it was a single &, I was just testing you... [http://forums.massassi.net/html/tongue.gif]

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-07, 4:04 PM #19
What about setting that cog as the master cog, would that make it work? Or maybe heap verbs?

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited October 07, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!