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 → Been awhile since I've done this!
Been awhile since I've done this!
2003-02-13, 4:45 AM #1
Is there any way to get this to work? Theory is self-explainitory.
Code:
# Jedi Knight Cog Script
#
# BULLET.COG
#
# Create a bullethole on a surface, projectile class cog.
#
# [DP]
#

symbols
message    touched
message    created

int        source                            local
template   bh=+testhole

end

# ========================================================================================

code

Created:
   CaptureThing(GetSenderRef());
   Return;

Touched:
   source = GetSourceRef();
   If(GetSenderType() == 6)
      CreateThingAtPos(bh, GetThingSector(source), GetThingPos(source), GetSurfaceNormal(GetSenderRef()));
   Return;

end

Touched isn't being called on surfaces, which I want it to.

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

The Magician Saber System.

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

Completed
Judgement Day (HLP), My level pack
2003-02-13, 11:50 AM #2
Why dont you attach a cog to the projectile, then check to see if its hit by calling damaged? (Or touched)
Team Battle.
2003-02-13, 4:39 PM #3
Quote:
<font face="Verdana, Arial" size="2">Projectile class cog</font>


------------------
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
2003-02-13, 6:46 PM #4
touched: doesn't work that way. (unfourtunatly [http://forums.massassi.net/html/frown.gif] ) It will only be called if the projectile hits a thing.

The only possible work around I can think of is using removed:

Also, if the cog is referenced in the template, you don't have to use CaptureThing() at all.
-Hell Raiser
2003-02-14, 4:24 AM #5
[http://forums.massassi.net/html/frown.gif] Guess I also need to read more carefully in DM.
Quote:
<font face="Verdana, Arial" size="2">It is not sent by the toucher, but by the object that was touched. </font>

There has to be a way.

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

The Magician Saber System.

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

Completed
Judgement Day (HLP), My level pack
2003-02-14, 12:35 PM #6
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Hell Raiser:
The only possible work around I can think of is using removed:</font>

And how would you get a reference to the surface it hit in removed:?


------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2003-02-14, 3:08 PM #7
Well, you could use the Sector at Position code, and modify it a bit to get the surface that the bullet is closest to. Might wanna stick the bullet hole about 0.005 jku's infront of the surface tho, so you can see it. [http://forums.massassi.net/html/wink.gif]

Are surface normals done in PYR? Remember, the last thing of CreateThingAtPos() is in PYR, not LookVector.

[edit]

Heck, not even that. Just run through the surfaces in the sector that the thing was removed in. Check (somehow, not too keen on this atm) which surface is closest, then create the bullet hole like you're doing above. [http://forums.massassi.net/html/smile.gif]

[This message has been edited by Hell Raiser (edited February 14, 2003).]
-Hell Raiser
2003-02-14, 3:22 PM #8
That sector-at-position code isnt worth ****. And besides, there isnt any reliable way to get the "closest" surface.


But, if you wanted to...


Code:
Removed:

Victem = Getsenderref();
Killed_sec = Getthingsector(Thing);


Should give you the ending sector.


Then you might create another object at the position, that would attach to the nearest surface (kinda like the seq charge does, too bad I dont remember how). The new object would be the bullet-damage sprite.
And when the moment is right, I'm gonna fly a kite.
2003-02-14, 4:33 PM #9
Or you could open up Gunboys mod and check how he did it.. its all in the templete for a sprite.
Team Battle.
2003-02-14, 4:58 PM #10
Ah, GBK and Hellcat are on the right idea. Just make your explode= a bullet hole, and fleshhit= something else. Your bullet hole template would be like the rail det (it sticks to everything) and just model your bullet hole (not sprite, sprites are messy) so that it's orientated correctly when it's attached. (might wanna give the explode= template some velocity so it gets attached)

[This message has been edited by Hell Raiser (edited February 14, 2003).]
-Hell Raiser
2003-02-15, 1:40 AM #11
Well...bulletholes are easy, but you could make other good use of getting a reference to the wall a bullet hit. I'd really like to know how you would get the closest wall to the bullet in removed:...

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2003-02-15, 6:29 AM #12
OMG I completly forgot about the sequencers (they aren't in The Sniper Missions). Thank you, thank you! I figured out a way that works to make the proper bullet holes!
Bullethole template
Code:
# DESC: 
# BBOX: 0 0 0 0 0 0
+testhole         none               orient=(0/0/0) model3d=bh.3do move=physics timer=5 type=weapon collide=1 size=0.01 movesize=0.01 physflags=0x90 typeflags=0x80 angvel=(0/0/0) buoyancy=0.15 surfdrag=5 airdrag=1 mass=0.1 vel=(0/.1/0)
There might be a few things that I could chop off (buoyancy, airdrag) but this works. And you also need this as well.
Code:
# Jedi Knight Cog Script
#
# BULLET.COG
#
# Create the bullethole when the origanal bullet was removed. Projectile class cog.
#
# [DP]
#

symbols
message    touched
message    removed

template   bh=+testhole

end

# ========================================================================================

code
Touched:
   // Only called when the projectile hits another thing, the origanal problem
   // So if we set the things userdata to 1 here
   SetThingUserData(GetSenderRef(), 1);
   Return;

Removed:
   // We won't create the bullet hole here
   If(GetThingUserData(GetSenderRef())) Return;
   CreateThing(bh, GetSenderRef());
   Return;

end
This cog goes on your origanal weapons projectile. This is free for anyones use here. $10 on Hellcat using this. Thank you all. Thank you! (rpts)

------------------
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
2003-02-15, 11:39 AM #13
/me whisles

*copy, paste*

[http://forums.massassi.net/html/biggrin.gif]
Team Battle.
2003-02-15, 12:06 PM #14
Yea! I'm $10 richer! [http://forums.massassi.net/html/smile.gif]

edit/Update - increase the surfdrag (50 or so) and teh forward vel (1 or so). You can remove the bouyency.

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

The Magician Saber System.

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

Completed
Judgement Day (HLP), My level pack
2003-02-15, 4:49 PM #15
I found a very simple way to do this already.

When your bullet projectile hits a wall it creates an explosion that creates bullet hole debris, and the bullet hole is flagged like the sticky rail. It won't always make a bullet hole because sometimes the hole will go the wrong way, but you could just attach a cog to it that has a timer set and if the the hole is still moving, then destroy it.

[This message has been edited by Ace1 (edited February 15, 2003).]
I am _ Ace_1 _ , and I approve this message.
2003-02-16, 12:28 AM #16
That's exactly what Hell Raiser suggested above and what most mods are doing.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2003-02-16, 3:25 AM #17
Personally, I think my way is simpler because it always works and it always works the same way. The only difference is the rotation of the thing on the surface, but that makes for greater diversity. It's just a cog that you attach to _weapon and all of the other weapon template shall have it. And all you have to do is add the template under _weapon to make it work.
BTW - I haven't seen a real bullet hole mod out there, just ones that use sprites.

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

The Magician Saber System.

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

Completed
Judgement Day (HLP), My level pack
2003-02-16, 8:11 AM #18
oops I didn't see his post

------------------
- __Ace_1_
I am _ Ace_1 _ , and I approve this message.
2003-02-16, 8:15 AM #19
In the JKinstagib mod, those shockwaves seem to align with surfaces with no problem... I would take a look.
I am _ Ace_1 _ , and I approve this message.
2003-02-16, 12:39 PM #20
Can I get a link because I can't find it?

------------------
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
2003-02-17, 9:36 AM #21
Link to the instagib mod:
http://www.massassi.net/levels/files/1730.shtml

------------------
And they have much to be concerned about. There is always the threat of an attack by say, a giant space dragon, the kind that eats the sun once every 30 days. It's a nuisance, but what can you expect from reptiles. Did I mention that my nose is on fire, that I have 15 wild badgers living in my trousers? I'm sorry, would you prefer ferrets?
-Marcus (Babylon 5)
"I'm only civil because I don't know any swear words."

-Calvin

↑ Up to the top!