Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 02:02:59 PM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom Wep
Pages: [1]
Author Topic: Custom Wep  (Read 7244 times)
Manmax75
Poster

Posts: 254


Programming Guy


« on: September 04, 2010, 12:09:36 AM »

Hello, just wondering, how can I make it display a person died by a custom weap when the person is identified. For example if a person has a radar and they die, it will tell people they had a radar by showing the radar icon in the menu that comes up when you identify someone, so I was wondering how can I do that with my own custom weap and how can I have my own custom icon with it too.

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #1 on: September 04, 2010, 06:51:08 AM »

suggestions?

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #2 on: September 04, 2010, 10:31:44 AM »

The radar is not a weapon, it's an equipment item. Note that default TTT weapons like the silenced pistol are not shown in their body search either. Weapons drop next to the corpse anyway. Items like radar don't, so they're shown in the body search.
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #3 on: September 05, 2010, 08:48:46 PM »

well I am looking for a way to show how they died, like for my sucide bomb i would like to show everyone that the traitor blew himself up via one.

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Firespray
Build Tester
*
Posts: 1447


:-(


« Reply #4 on: September 05, 2010, 09:46:42 PM »

sucide bomb

>:(

Quote
Z3RO: Tanners sister isnt bad looking :v
Firespray: New sig
Z3RO: noooo

holocalls traumatize worbat
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #5 on: September 05, 2010, 09:47:32 PM »

Not worth commenting on FireSpray...

It's up to him what he wants to put on his server... Though personally, even though I'm using custom sweps I would never implement the jihad.
« Last Edit: September 05, 2010, 09:49:22 PM by phoenixf129 »

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Rectal Exambot
Poster

Posts: 166


« Reply #6 on: September 06, 2010, 05:19:29 AM »

On his server it takes about 10 seconds, you go to 10 health and you go red when you activate it. Not as stupid as the jihad bomb. But still... pretty cheap.
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #7 on: September 06, 2010, 08:17:32 PM »

I would never implement something unbalanced

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Darkebrz
Poster

Posts: 189


« Reply #8 on: September 07, 2010, 02:57:10 AM »

I would never implement something unbalanced

NEVER
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #9 on: September 07, 2010, 06:00:21 AM »

what? Please on topic here. Still looking for an anwser

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #10 on: September 07, 2010, 07:42:38 AM »

Make the custom weapon the inflictor of your explosion damage. How you do that depends on how you create the explosion, but util.BlastDamage has an inflictor parameter.
Mr. Gash
Poster

Posts: 382


www.nonerdsjustgeeks.com


« Reply #11 on: September 08, 2010, 05:35:24 PM »

Wouldn't that stop the traitor who used it to get the kills from the explosion?
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #12 on: September 08, 2010, 06:01:40 PM »

No. What do you think the "attacker" parameter is for on that function?
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #13 on: September 09, 2010, 06:48:02 AM »

wait, so how does setting the custom inflicter work, like do I have to change something in like the corpse.lua to show the new icon
« Last Edit: September 09, 2010, 06:51:01 AM by Manmax75 »

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #14 on: September 09, 2010, 07:14:36 AM »

You already have an icon set in your SWEP.

Make the weapon the "inflictor" of the damage and it will show that icon in the search window.
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #15 on: September 09, 2010, 08:52:37 AM »

o cool. Ok, one more thing. The swep spawns an entitty and the entity makes the explosion but the icon is set in the swep. Do i need to carry a variable across to keep the SWEP.Enity? or do I assign the inflictor to the entity that was spawned. Cause atm the entity that spawned is the inflictor with damage type set to DMG_BLAST
« Last Edit: September 09, 2010, 08:56:44 AM by Manmax75 »

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #16 on: September 09, 2010, 10:09:56 AM »

I'm not sure why you're making it spawn an entity if it just needs to cause an explosion right away, but okay.

You'll have to set a few things in the entity:
ENT.PrintName = "<weapon name>"
ENT.Icon = "<same icon as the weapon>"
ENT.Projectile = true


Then make the entity that creates the explosion the inflictor of it. TTT will see that it is set as a "projectile" meaning it will display the printname and icon from that entity in various places. The thrown knife uses the same mechanism.
Charles445
Build Tester
*
Posts: 2338


I LOVE THIS AVATAR


« Reply #17 on: September 10, 2010, 05:03:25 AM »

The reason it's spawning an entity is likely because he's modifying the existing jihad bomb.

del>Ok, so Bad King, you are just going to wait for Garry to fix?
What an idiotic thing to ask. Dammit weed.

Bookcases, Bookcases Everywhere
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #18 on: September 10, 2010, 06:45:43 AM »

well i actualy wrote the code by hand, but I feel better when I spawn an enitity :D

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom Wep « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.01 seconds with 18 queries.