easy 1line port to your own primary house?
Hey im looking for a simple 1 liner if possible to port to my own primary house outside if possible..
something like: local playerId = GetDisplayName() JumpToHouse(playerId) one that actually works... I cant for the life of me get any of these functions todo it. everything i try reports back either "cannot port to yourself" or "character not found". |
RequestJumpToHouse(GetHousingPrimaryHouse(), false)
true if jump inside Can be found by inspecting the button at your collections where you can show the menu to jump in/outisde your house e.g. move the mouse above and use /zgoo mouse or merTorchbug /tbm to show the name of the control. ZO_HousingBook_KeyboardContentsHousingInteractButtonsTravelToHouse Then search the end of the name "TravelToHouse" in the ESOUI sources and you'll find the ShowMenu (shows the context menu) call in function HousingBook_Keyboard:RequestJumpToCurrentHouse(): Lua Code:
|
omg thank you soo much!
|
Quote:
|
I've copied you the code of the base game above showing you the function call, and even named you the function:
HousingBook_Keyboard:RequestJumpToCurrentHouse( In the example code you can see: local TRAVEL_INSIDE = false RequestJumpToHouse(houseId, TRAVEL_INSIDE) local TRAVEL_OUTSIDE = true RequestJumpToHouse(houseId, TRAVEL_OUTSIDE) This should be very obvious wha the API function RequestJumpToHouse uses for inside and outside then :-) What was wrong was my text "true if jump inside", but I always assume you guys tests stuff before actually releasing it. |
haha ya i did test it but was testing other things at the same time and didnt. "clue in" that it was going inside till later.
I am however still having issues with some of the isunitonline and ingroup etc... its messy cuz ive been trying everything to get them passing and not passing when they should but heres a sample of what im trying todo. it shold not continue if im incombat or the target player isnt online or isnt in group and should execute the basic jumpto only giving the error in the top right corner which im happy with. Code:
-- Travel to player |
You always should read the API documentation txt file for the parameters and parameter TYPES used! unitTags are not the same as character names or displaynames!
Afaik IsUnitInCombat(unitTag) only accepts unittags like "player" (yourself), "group1" to "groupN", "boss1" to "bossN" or "reticleover" and not any charactername or displayname! So you cannot test IsUnitInCombat for any name on the server, only for yourself or grouped players. There exist API group functions to check what name the group1, group2 etc. tags have but I'm not sure anymore, you need to search the API documentation txt file for them I think it was a loop over group members by Code:
for i=1, GetGroupSize() do |
sweet ty... i was missing the quotes in the unitag ones.. theyre working now but your correct the isunitonline wont work for other players :( ill have to find a workaround cuz its semi important as well.. dont want the code firing off effects if they player isnt even online to port to.
|
and i have been reading all the documentation and wiki and api function pages but am very new at this and imo my logic is ok but im having the most difficulties with strings boolean etc like how and when to use them or say it is one or the other etc.. i cant find that info yet online so had to resort to creeping other addons to give insight on theyre usage.
|
Yeah I get that. The WIKI is outdated at many api pages so you better check the API version list ->
https://wiki.esoui.com/APIVersion there you'll find the txt documentation attached at each version (e.g. current live server or PTS). API TXT Documentation: https://www.esoui.com/forums/attachm...6&d=1663783675 In the txt files you'll find the API functions which are valid, there parameters and there types. Search within these files then, not at the Wiki! e.g. for GetGroup or GetUnit or IsPlayer or IsDisplayName or IsCharacter etc. to find API functions for that purpose. If you search the Wiki you might get extr info (about events etc.) but it ight be outdated, so always take the txt API files as the "what is currently the state of the art". |
Quote:
its all working flawlessly now except i had to remove the isunitonline(savedPlayer). this player would have to be in group and me not to be incombat for it to fire off. I was hoping to cover them not being online as well but havent been able to test if the isplayeringroup(savedPlayer) might kick back an error if theyre offline and work just as well. I just dont want the effects firing off for porting and then getting an error theyre offline is all. rest is flawless now. |
Quote:
Code:
function RidinDirty.TravelToPlayer() |
Quote:
The quotation marks in GetUnitDisplayName shouldnt be there. It should be: Code:
GetUnitDisplayName(savedPlayerId) Instead of creating and overwriting your save variables 6 times during initialization, i recommend doing it once and provide your default values within one table. |
Quote:
|
All times are GMT -6. The time now is 05:16 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI