auto-SetScale when logging script

Hello :slight_smile:

I use Zonemap scaled at 0.9 cause it fits perfectly into my UI that way. The problem is, everytime I log in and after every reload, it resets to 1.0 reason why I made a macro of that set scale command to hit everytime, but it’s getting a bit annoying.

/run BattlefieldMapFrame:SetScale(0.9)

A few weeks ago, while searching how to solve another issue I had then with Zonemap, I found this topic providing the solution with a script/addon that runs the above commands (resets the position of zonemap) automatically when logging in

/run BattlefieldMapFrame:ClearAllPoints() 
/run BattlefieldMapFrame:SetPoint("CENTER", UIParent, -200, 200)

reset Zonemap to centre script

open SPOILER
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, addon)
	if addon == "Blizzard_BattlefieldMap" then
		self:UnregisterAllEvents()
		hooksecurefunc(BattlefieldMapTab, "SetPoint", function(self)
			if self.OnHook then
				self.OnHook = nil
				return
			end
			self.OnHook = true
			self:ClearAllPoints() 
			self:SetPoint("CENTER", UIParent, -200, 200)
		end)
	end
end)

This script/addon adapted for SetScale would be THE solution but… I have no such skills, I can barely guess by reading the code, compare to the commands and try do some puzzle copy-paste work and hope it’s not too far away from how it should be… something like

local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, addon)
	if addon == "Blizzard_BattlefieldMap" then
		self:SetScale(0.9)
	end)

So I was hoping somoene could help me out write it down correctly? Thankyouverymuch :blue_heart:

Could just remove the /run from your basic commands and slap the rest into a WA as a custom action.

why would i wanna have to make a WA to press everytime the map resets back? already got a macro to do that job, i just need that script that gets saved as addon and will do the job forever inside AddOn folder.

Also: just recently I had to reinstall everything and reset all cvar cause of WA & co. so I’m trying to relay less on them for stuff that can be done without and use them only for what i really need…I started the topic with already a more simple raw solution there, i just don’t have the skills to write it correctly myself

local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, addon)
	if addon == "Blizzard_BattlefieldMap" then
		self:SetScale(0.9)
		self:ClearAllPoints() 
		self:SetPoint("CENTER", UIParent, -200, 200)
	end
end)

Thanks

can you tell me what this part does? i reconize it from the set point script, if it’s gonna move my zone map from its position? if so i need it removed, would it look like this if i do that?

local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, addon)
	if addon == "Blizzard_BattlefieldMap" then
		self:SetScale(0.9)
	end)

Thank you

I just added these commands

To this

and added the missing end

lol

:dracthyr_tea:

I see…

:dracthyr_tea::dracthyr_a2:

So you just forgot to read in between the two scripts…? Or for what reason did u merge them? That would just get one annoying issue (the reset scaling) replaced with another even more annoying issue (zonemap mid screen every loggin, reload & relogg) makes absolute no sense.

I just need Zonemap to not set back to 1.0 everytime i reload & relog, and as the linked script is A) based on this same premise and B). about the Same cvar (battlefieldmapFrame) i linked it / used it as a base but, as written in the opening post, i need a version with SetScale instead SetPoint, merging them has never been part of this topic’s used vocabulary.

:dracthyr_no1: :dracthyr_tea:

But yeah, don’t worry, nothing serious…

It’s not like who pretends to read can only pretend to help, right? That can’t be…

:dracthyr_no1: :dracthyr_tea:

It’s just about missing the main and only reason why this topic exists and reply with some random (merged) redbull-s despite it! (…now I get why that WA comment at least…)


:dracthyr_no1: :dracthyr_no1: :dracthyr_tea:

But hey, cheer up:

You can merge two scripts!! That’s GREAT! It’s more then what I can do!


NOTICE:

WARNINGN: please restrain yourself from wasting my time even more and DO NOT reply to this if it’s not topic related. Topic being my issue with a script, not your failure to meet a certain quality standard when providing help on the game’s official forum. Noted: quality standard set at “Read content” not P.h.D in programming.

This kind of help does more damage than just not providing the help asked for and serves only your personal entertainment.



To Blizzard Team:

my apolgies in advance for getting so mad at this but this last 2 weeks this kind of help is the only one i got everywhere and it is very time consuming and exausting. Not to mention not get me even one step closer to a solution.

If you want to get help, getting angry at people who are trying to help you in their free time is generally not the best way to go about it. They aren’t getting paid for any of this. Also Blizzard doesn’t read these forums.

Anyway, try this, I think it should do what you’re looking for. This is all the code, no need to CreateFrame/RegisterScript etc, usual drop into addon.bool.no advice applies.

EventUtil.ContinueOnAddOnLoaded("Blizzard_BattlefieldMap", function() BattlefieldMapFrame:SetScale(0.9) end)

If I’m not understanding the question, please do explain it in further detail, gently.

3 Likes

thank you for the reply, I’m gonna test your version after done with reply :slight_smile:

I am aware no one is getting paid to help and I don’t expect to get what I’m looking for everytime I do need help. If no one replies, I usually stil wait some days before post it again somewhere else (this to not waste helpfull ppl’s time by having more fronts getting help).

Sadly, recently when people reply it’s not to help but by starting a discussion about what, in their not asked opinion, I should do instead 'cause they know better (just assuming to know what I already did and did not do so far…) and get carried by their know-how show-off that has poorly anything to do with my issue. It’s a forum, I get it, but a help request topic should stay that and not get twisted into some weird discussion+experiments by very bored supportforum-wannebe-nurses that didn’t even bother to read your help request to begin with.

After you put some effort and time writing it as informative you can, add additional info from reasearch you did before even bother anyone with it, all to make it as understandable as you can… Yeah, it pissed me off! I don’t open a help request to entertain some bored support-forum camper here to play “helper” just to feed his ego. I know I was rude (and stil am) to write that previous post but I’m just human and when he said he merged the 2 scripts… after a first «lol, what? why? disbelieve, I got angry…

Why? 'cause I realized that all the time I spent involving his replies, converting his “scripts” into addon, download+add it to addons, start bnet, start wow, disable all addons but that one, test if it works, not working? go back and invest even more time typing to explain what u just did and what did not worked as it meant and this s*** twice… all that time just wasted as he didn’t even knew what the issue was and just saw 2 scripts, merged them and posted it as it would be the solution for me… (and one wasn’t even a script, just patch-work made by me to get an idea about what I meant, and I got no clue about scripting)

So yeah, sometimes not get anyone to reply / not get any help at all is better.
Better than that for sure.

So, now… TIME TO TEST YOUR VERSION!
:dracthyr_nod: :notes:


edit: I can’t post twice in a row so here little update:

oooooooooh I am very very happy!
:dracthyr_uwu: :blue_heart:

It works perfectly! I’m stil in disbelieve somewhat ahahah
:dracthyr_crylaugh:

Thank you so very very much!!! I really appreciate!
…and I can finally close this odyssey too!
:dracthyr_heart: :heart:

Take care! :blue_heart:
Thenebra-Darkspear


ps. Im amazed by the fact that the working script is that short!
A very Less is More ending for this odyssey
:dracthyr_uwu:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.