Beginner's Guide to Lua Gossip menu

Shout-Out

User Tag List

Results 1 to 14 of 14
  1. #1
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Beginner's Guide to Lua Gossip

    Alright. I’ve been looking around for a nice guide on creating Lua Gossips and I couldn’t find one. So I decided to take the time to make a nice simple guide to creating a teleport NPC. It’s a pretty simple NPC in reality, and I feel the best way to learn is to do it yourself. So this guide will largely force you to do the work. When it comes to learning these sorts of scripts you should look at other people’s work so that you can get an idea of how these sorts of things work. This doesn’t mean copy and paste! That helps no one…

    So here we go. We are going to start with this little piece of our script. I’ll break it down right now. The local npcid is stating which NPC will use this script. The function is… well… what your script is going to do. pUnit:CreateGossipMenuForPlayer creates the gossip menu for player. The pUnit:MenuAddItem adds an item to the menu. Then there is the self-explanatory “end” line.

    Code:
    local npcid = 100000
    
    function warp_on_gossip_talk(unit, event, player)
    	pUnit:CreateGossipMenuForPlayer(3543, player)
    	pUnit:MenuAddItem(player, 0, "First Gossip Lua", 1, 0)
    	pUnit:MenuSendToPlayer(player)
    end
    So now that we have this little set up we can move on to creating something worthwhile. We need to create the next part of our script. So we are going to add this to the script.

    Code:
    if(intid == 1) then
    player:Teleport(0, x, y, z)
    end
    We are going to add this little bit of Lua to the bottom of our script. This is stating that if someone selected “First Gossip Lua” (You can see the intid == 1, just need a little reasoning to figure this one out), then you will be teleported to this location. The 0 is stating the mapid. Now the important part. x, y, z coordinates are a must. Go in game. Find a place you want this to port you too. Simply type .gps and bam! You’ve got your coordinates. Always, I repeat ALWAYS round your Z coordinate up to avoid falling through the world when being ported. Now to finish our script.

    Code:
    RegisterGossipEvent(100000 , 1, "warp_on_gossip_talk")
    RegisterGossipEvent(100000 , 2, "warp_on_gossip_select")
    Well that sums up our script. If you forget that final part then, well your whole script won’t work. Make sure you’re local npcid == the number in the registering part of your script. So now your script should look like this.

    Code:
    local npcid ==100000
    
    function warp_on_gossip_talk(unit, event, player)
    	pUnit:CreateGossipMenuForPlayer(3543, player)
    	pUnit:MenuAddItem(player, 0, “First Gossip Lua”, 1, 0)
    	pUnit:MenuSendToPlayer(player)
    end
    
    if(intid == 1) then
    player:Teleport(0, YOUR X COORD, YOUR Y COORD, YOUR Z COORD)
    end
    
    RegisterGossipEvent(100000, 1, “warp_on_gossip_talk”)
    RegisterGossipEvent(100000, 2, “warp_on_gossip_select”)
    There you go! I’ll be back to add more. Up next… Morph NPC! Hopefully this helped someone out. If not... well it was fun writing it.
    Last edited by Dr. Livingstone; 10-21-2008 at 05:34 PM.

    Beginner's Guide to Lua Gossip
  2. #2
    Jonthe838's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what programs do u need to do this and how do u make the scripts work?
    i downloaded a scrit from this site but it dident work
    Last edited by Jonthe838; 10-15-2008 at 09:40 AM.
    Lines of Coding: |||||||||| Goal 1000
    Current: 677 Achived Goals: 500 Lines


  3. #3
    oMSQo's Avatar Member
    Reputation
    14
    Join Date
    May 2008
    Posts
    52
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what means Gossip
    Sorry i'm just a begginer

  4. #4
    Lauren's Avatar Member
    Reputation
    14
    Join Date
    Jul 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jonthe838 View Post
    what programs do u need to do this and how do u make the scripts work?
    i downloaded a scrit from this site but it dident work
    You need to have lua++ enabled.

    Lua++, Download

    Extract to your ascent (Or openascent) folder. Then go into your ascent-world.conf and find

    Code:
    #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    # Scripting Engine Setup
    #
    #    Ascent can support multiple script backends via the means of loading .dll files for them.
    #    This section in the config can enable/disable those backends.
    #
    #    LUA
    #         If you would like to enable the LUA scripting backend, enable this.
    #         Default: 0
    #
    #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    
    <ScriptBackends LUA="0"
                    AS="0">

    And change it to:

    Code:
    #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    # Scripting Engine Setup
    #
    #    Ascent can support multiple script backends via the means of loading .dll files for them.
    #    This section in the config can enable/disable those backends.
    #
    #    LUA
    #         If you would like to enable the LUA scripting backend, enable this.
    #         Default: 0
    #
    #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    
    <ScriptBackends LUA="1"
                    AS="1">


    - Original Posted by: Dragonshadow
    Last edited by Lauren; 10-15-2008 at 01:50 PM.

  5. #5
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for helping them out Gossip is what creates teleporters, morphers, that sort of thing. Something that the player communicates with. Like guards. Hope that cleared things up oMSQo

  6. #6
    Lauren's Avatar Member
    Reputation
    14
    Join Date
    Jul 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jman9368 View Post
    Thanks for helping them out
    You're welcome =)

  7. #7
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +Rep for being so helpful Lauren. Couldn't do it earlier. Has this guide helped anyone out?

  8. #8
    Lauren's Avatar Member
    Reputation
    14
    Join Date
    Jul 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure, but I like your guide. It very helpful for people who want to know about the basic stuff in lua gossip. =)
    +Rep =)


    Edit: Need to spread some rep around first
    Last edited by Lauren; 10-17-2008 at 04:13 AM.

  9. #9
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks anyways Really hope people can use this.

  10. #10
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks good. Nice detailed guide.

    Might suggest the use of colors. Not alot, just like a bit of contrast. People find things with contrast easier to read

    +rep x2

    I live in a shoe

  11. #11
    stoneharry's Avatar Moderator Harry


    Reputation
    1615
    Join Date
    Sep 2007
    Posts
    4,558
    Thanks G/R
    151/147
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Agreed with Sounddead but don't make the whole thing red for example, or a different colour for every word =p +Rep x2

  12. #12
    Ollox's Avatar Member
    Reputation
    5
    Join Date
    Oct 2007
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very Nice guide im learning lua it was usefull and btw i wish i could rep but im on my iPhone
    Lua knowledge [||||||||||]

  13. #13
    ArciX^'s Avatar Member
    Reputation
    1
    Join Date
    Oct 2008
    Posts
    46
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LUA script is so complicated! Nice guide man. Keep up the good work!

  14. #14
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys. Will deffinatelly add some color here in a bit. Been trying to pick up some C++ and Hypnotic WoW has been taking up a good bit of my time. I'll get to work on making this guide better too Glad I helped some people out.

Similar Threads

  1. [Guide] Lua Gossip on Items (Average)
    By AngelSandy in forum WoW EMU Guides & Tutorials
    Replies: 8
    Last Post: 06-20-2009, 07:15 PM
  2. [Guide] Another LUA Scripting Guide
    By Bapes in forum WoW EMU Guides & Tutorials
    Replies: 13
    Last Post: 05-08-2008, 05:01 PM
  3. [Guide]More LUA ascent 2.3 scripts
    By Pragma in forum WoW EMU Guides & Tutorials
    Replies: 27
    Last Post: 04-10-2008, 01:06 PM
  4. [Guide] Troubleshooting LUA 101
    By EcHoEs in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 04-10-2008, 08:23 AM
  5. Beginners MC Guide
    By Amedis in forum World of Warcraft Guides
    Replies: 7
    Last Post: 01-05-2007, 11:44 PM
All times are GMT -5. The time now is 08:19 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search