A few questions about working with GUIDs menu

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by tyeeeee1 View Post
    The script is running properly now. I'm slightly lost on what you did there. What is tostring and why did it work?


    Thank you for helping me ^.^
    The data type being compared was a GUID, which you can think of as a memory address. It's like saying if icecream == car, you can't really find a basis to compare them on.

    However a string can have all the characters that a GUID has in it, but follows a strict set of rules which allows it to be compared. By using:

    tostring(data) we turn it into a string, so when both of them are strings we can compare to see if they are the same.

    If you are still unsure, google different data types (such as integers, booleans, floats and strings being the most common).

    A few questions about working with GUIDs
  2. #17
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That makes a lot more sense now. I'm used to using booleans, intergers, strings, etc... when triggering in Wc3 so that helps when I need to understand them =P

    So basically you say if "This string of numbers (the GUID)" is the same as "This string of numbers (Get the GUID of the unit being manipulated)" then if they are the same continue.

  3. #18
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Yes.

    The GUID is what identifies the creature as unique, and generated upon being spawned (I don't know what the data format is, maybe a memory address).

    By converting it to a string we can now compare it (as I said in my last post) as a set of characters rather than what it previously was.

    You can't do: tostring(GUID):SendChatMessage()

    Because the server won't know what a random string of characters is, and why it is trying to invoke a method.

  4. #19
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This makes me think that it would be quite useful if someone developed a GUI similar to the Warcraft 3 World Editors triggering UI. Then just about anyone could create complex codes with minimal knowledge.


    Well now I know a bit more about Lua and how to script for an individual spawn!

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Questions about Kopp's Guide (not about downloading it)
    By kc0716 in forum World of Warcraft General
    Replies: 6
    Last Post: 02-28-2007, 04:08 PM
  2. A few questions about model editing
    By Kelindel in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 01-01-2007, 11:23 PM
  3. A few questions about model editing
    By Kelindel in forum World of Warcraft General
    Replies: 0
    Last Post: 01-01-2007, 08:57 PM
  4. A few questions about WoW
    By colm in forum World of Warcraft General
    Replies: 2
    Last Post: 08-23-2006, 12:04 PM
All times are GMT -5. The time now is 08:39 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search