Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

LUA et_Obituary

- - - - -

  • Please log in to reply
7 replies to this topic

#1
OFFLINE   TimOOn

TimOOn

    Newbie

  • Members
  • Pip
  • 7 posts
1
A step in the right direction

Hello,

 

I was playing with et_Obituary function recently and I tried to replace obituary message with my own. It doesn't work the way I expected. If a string is returned from this function it does replace default obituary, but message is displayed on chat area instead of cpm (popup) like other obituaries.

 

Is there a way to print custom obituaries on cpm area? I know I could use "et.trap_SendServerCommand" to do that but it won't overwrite the original message, so both of them will be printed.  :unsure:



#2
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

Behaviour depends on the g_logOptions flag 1.

http://mygamingtalk....ar#g_logOptions



#3
OFFLINE   TimOOn

TimOOn

    Newbie

  • Members
  • Pip
  • 7 posts
1
A step in the right direction

oO Thanks for help. I never would have found this. I'm wondering why I even set this flag.



#4
OFFLINE   Kynval

Kynval

    Member

  • Members
  • PipPip
  • 30 posts
1
A step in the right direction

It is no problem to creat obituaries for killing myself...

but how to add killer name if i'm killed by someone?

 

like in ETPUB 0.9.1:

 

set g_obit206 "[v]^7 was killed by [a]^7's knife."

 

but in silent i want to do it by lua..

can someone explain me?


Edited by Kynval, 19 September 2014 - 10:17 AM.


#5
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

You implement et_Obituary callback http://mygamingtalk....Lua#et_Obituary. You can see the MOD values from G_Damage http://mygamingtalk....t_Lua#G_Damage.



#6
OFFLINE   Kynval

Kynval

    Member

  • Members
  • PipPip
  • 30 posts
1
A step in the right direction

But i'm not too good with lua's, so please make a one explain for me :)

 

 

if victim == killer and meansOfDeath == 206 then

customObit = "^7%s ^zwas killed by" ..killername.. "by knife." 
return string.format(customObit, et.gentity_get(victim, "pers.netname"))
end

?

 

And where can I find full list of Obituaries ?


Edited by Kynval, 19 September 2014 - 03:04 PM.


#7
OFFLINE   Kynval

Kynval

    Member

  • Members
  • PipPip
  • 30 posts
1
A step in the right direction

Why don't you make it like in ETPub

 

http://magics-territ...obituaries.html

 

??



#8
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

Just read the links I posted, it is very clear then. I agree that creating a Lua script is a bit more work. The reasons why we remove certain abilities that were in ETPub, has been to make the experience more consistent to players. Also, some features were pretty much experimental. Couple mistakes were made, but this is not one of those. If you are new to scripting, please read a Lua tutorial first. It will be easy then and Lua is very easy scripting language.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users