• Print

Author Topic: halo shenanigans  (Read 4207 times)

0 Members and 1 Guest are viewing this topic.

Offline talmera

  • Newbie
  • *
  • Posts: 36
  • Karma: 4
    • Tectonic-Gaming
halo shenanigans
« on: July 08, 2014, 05:23:57 pm »
I'm having this weird problem when trying to draw halos

Code: Lua
  1. hook.Add( "PreDrawHalos", "Orb Halos", function()
  2.                
  3.                 halo.Add( ents.FindByClass( 'tg_orb' ) , TCC_WHITE, 1.5, 1.5, 1, true, false )
  4.         end )

the above code works fine but as soon as i try to substitute ents.FindByClass like so

Code: Lua
  1. hook.Add( "PreDrawHalos", "Orb Halos", function()
  2.                
  3.                 halo.Add( ents.FindByName( 'NormalOrb' ) , TCC_WHITE, 1.5, 1.5, 1, true, false )
  4.         end )

it fails to find anything, I know for a fact i have successfully set the names of the orbs as (big thanks to Stickly) I am using it to make a rainbow orb rotate it's colours. Any ideas as to why it doesn't like finding by names in this hook?
It's not a sin if it can't make me cry
He's not the devil unless there's fire in his eyes
It ain't the ghost if it don't speak in tongue
It's not a victory 'till the battles been won

Offline bender180

  • Full Member
  • ***
  • Posts: 217
  • Karma: 42
    • Benders Villa
Re: halo shenanigans
« Reply #1 on: July 08, 2014, 06:38:07 pm »
i know halo expert or lua expert for that matter but shouldn't the hooks 2nd value be different on each of them?
Made community pool and community bowling and for the life of me couldn't tell you why they are popular.
Also made the ttt ulx commands.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: halo shenanigans
« Reply #2 on: July 08, 2014, 06:44:24 pm »
i know halo expert or lua expert for that matter but shouldn't the hooks 2nd value be different on each of them?
I don't think that matters in this case, as since I understood it, he's replacing a part of the function and not running two of them.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline talmera

  • Newbie
  • *
  • Posts: 36
  • Karma: 4
    • Tectonic-Gaming
Re: halo shenanigans
« Reply #3 on: July 08, 2014, 07:40:22 pm »
Yea sorry this is a replacement not them being run simultaneously I originally had all orbs with the white halo but I want to give a more unique halo to different categories and I have decided the easiest way to do that is through ent.SetName(). ents.FindByName() works perfectly fine within the think hook but has trouble in PreDrawHalos and I don't know why XD
It's not a sin if it can't make me cry
He's not the devil unless there's fire in his eyes
It ain't the ghost if it don't speak in tongue
It's not a victory 'till the battles been won

  • Print