User Tag List

Results 1 to 4 of 4

Thread: Creature/Player/Gameobject custom data

  1. #1
    Member
    Join Date
    Jul 2016
    Posts
    15
    XP
    176
    Level
    2
    Thanks
    0
    Thanked 1 Time in 1 Post

    Creature/Player/Gameobject custom data

    I thought i wrote somewhere that you can have variables per player/creature/gameobject?
    Or am i totally wrong.

    Like

    Creature:SomeCustomData("SomeCustomVariable")

    Or something in that way.
    I can't seem to find information about it.
    I think it was for eluna. not sure thought.

    Can anyone understand my confusing explanation.

  2. #2
    Super Moderator <span style='color: #FFFF00'><span class='glow_000000'>Kaev</span></span>'s Avatar

    Join Date
    Jan 2014
    Location
    Germany
    Posts
    535
    XP
    2,925,342
    Level
    335
    Thanks
    76
    Thanked 102 Times in 70 Posts
    Quote Originally Posted by LordSeaworth View Post
    I thought i wrote somewhere that you can have variables per player/creature/gameobject?
    Or am i totally wrong.

    Like

    Creature:SomeCustomData("SomeCustomVariable")

    Or something in that way.
    I can't seem to find information about it.
    I think it was for eluna. not sure thought.

    Can anyone understand my confusing explanation.
    Afaik there is no specific function for something like that.
    You could create a table in Lua and add your creature and your variable value to it.
    Achievements:
    Shopper Member 1 year registered Level XL Level C
    Awards:
    Raffle Winner Member of Staff Support LOL Drunk Donator


    Read the rules before posting.

    Do you have an unsolved issue? Give us more informations about your problem.

    Do you have problems with compiling or installing TrinityCore? Unknown96's Tutorial will help you.

    Visit our other helpful sites:
    EmuDevs SQL Generator

  3. #3
    Moderator / Eluna Dev <span style='color: #FF0000'><span class='glow_8B0000'>Rochet2</span></span>'s Avatar
    Join Date
    Apr 2013
    Location
    Finland
    Posts
    1,859
    XP
    13,487
    Level
    35
    Thanks
    95
    Thanked 591 Times in 418 Posts
    One way is like Kaev said.

    However there is another way to store some data.
    You should already have this in your lua_scripts folder:
    https://github.com/ElunaLuaEngine/El...tVariables.ext

    because of the .ext ending it should load before your normal lua scripts.
    Otherwise try using require("ObjectVariables")

    You can use it like this:
    creature:SetData("some key", 123)
    print(creature:GetData("some key")) -- prints 123
    Awards:
    Support LOL Scripter Facepalm! Raffle Winner
    rochet2.github.io - Home of great codes

  4. #4
    Original Poster
    Member
    Join Date
    Jul 2016
    Posts
    15
    XP
    176
    Level
    2
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks for that i'll look into that.

    Hmm i'm so confused where i read what i think i read.
    Maybe in my dream xp

    Well thanks for the help! both of you

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •