• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Frames Selection Effects

Thats a model for using as a sprite in a frames, for some selection effects


you can create it properly by using this code

LUA
Code:
       new_Frame = BlzCreateFrameByType("SPRITE", "justAName", frame_owner, "WarCraftIIILogo", 0)
       BlzFrameSetPoint(new_Frame, FRAMEPOINT_BOTTOMLEFT, frame_relative, FRAMEPOINT_BOTTOMLEFT, 0.02, 0.02)
       BlzFrameSetSize(new_Frame, 1., 1.)
       BlzFrameSetScale(new_Frame, 1.)
       BlzFrameSetModel(new_Frame, "selecter1.mdx", 0)


center of the model is offsetted, so you should offset it slightly too in right-top from bottom-left


Previews
Contents

Blue Selection Effect (Model)

Green Selection Effect (Model)

Purple Selection Effect (Model)

Red Selection Effect (Model)

Yellow Selection Effect (Model)

Reviews
General Frank
Probably useful for modders and especially UI coders.
Level 2
Joined
May 31, 2019
Messages
20
Great work! I've been looking for this kind of work all the time.
Thank you for sharing! ^_^
 
show me how you are creating them
  • Frames Initiate
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: REFORGEDUIMAKER.Initialize()
      • Custom script: BlzFrameSetVisible(TestFrame, true)
      • Custom script: BlzFrameSetVisible(new_Frame, false)
  • Click Button
    • Events
      • Game - TestFrame becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Button is Working
      • Custom script: BlzFrameSetVisible(new_Frame, true)
      • Custom script: BlzFrameSetParent(new_Frame, TestFrame)
Code:
new_Frame = BlzCreateFrameByType("SPRITE", "justAName", frame_owner, "WarCraftIIILogo", 0)
BlzFrameSetPoint(new_Frame, FRAMEPOINT_BOTTOMLEFT, frame_relative, FRAMEPOINT_BOTTOMLEFT, 0.02, 0.02)
BlzFrameSetSize(new_Frame, 1., 1.)
BlzFrameSetScale(new_Frame, 1.)
BlzFrameSetModel(new_Frame, "selecter1.mdx", 0)

Code:
TestFrame = nil 
BackdropTestFrame = nil 
TriggerTestFrame = nil 
REFORGEDUIMAKER = {}
REFORGEDUIMAKER.TestFrameFunc = function() 
BlzFrameSetEnable(TestFrame, false) 
BlzFrameSetEnable(TestFrame, true) 
globals.udg_TestFrame = GetConvertedPlayerId(GetTriggerPlayer()) 
end 
 
REFORGEDUIMAKER.Initialize = function()

TestFrame = BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) 
BlzFrameSetAbsPoint(TestFrame, FRAMEPOINT_TOPLEFT, 0.424300, 0.393930) 
BlzFrameSetAbsPoint(TestFrame, FRAMEPOINT_BOTTOMRIGHT, 0.458260, 0.362300) 
BackdropTestFrame = BlzCreateFrameByType("BACKDROP", "BackdropTestFrame", TestFrame, "", 1) 
BlzFrameSetAllPoints(BackdropTestFrame, TestFrame) 
BlzFrameSetTexture(BackdropTestFrame, "none.blp", 0, true) 
TriggerTestFrame = CreateTrigger() 
BlzTriggerRegisterFrameEvent(TriggerTestFrame, TestFrame, FRAMEEVENT_CONTROL_CLICK) 
TriggerAddAction(TriggerTestFrame, REFORGEDUIMAKER.TestFrameFunc) 
end
 
  • Frames Initiate
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: REFORGEDUIMAKER.Initialize()
      • Custom script: BlzFrameSetVisible(TestFrame, true)
      • Custom script: BlzFrameSetVisible(new_Frame, false)
  • Click Button
    • Events
      • Game - TestFrame becomes Equal to 1.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Button is Working
      • Custom script: BlzFrameSetVisible(new_Frame, true)
      • Custom script: BlzFrameSetParent(new_Frame, TestFrame)
Code:
new_Frame = BlzCreateFrameByType("SPRITE", "justAName", frame_owner, "WarCraftIIILogo", 0)
BlzFrameSetPoint(new_Frame, FRAMEPOINT_BOTTOMLEFT, frame_relative, FRAMEPOINT_BOTTOMLEFT, 0.02, 0.02)
BlzFrameSetSize(new_Frame, 1., 1.)
BlzFrameSetScale(new_Frame, 1.)
BlzFrameSetModel(new_Frame, "selecter1.mdx", 0)

Code:
TestFrame = nil
BackdropTestFrame = nil
TriggerTestFrame = nil
REFORGEDUIMAKER = {}
REFORGEDUIMAKER.TestFrameFunc = function()
BlzFrameSetEnable(TestFrame, false)
BlzFrameSetEnable(TestFrame, true)
globals.udg_TestFrame = GetConvertedPlayerId(GetTriggerPlayer())
end

REFORGEDUIMAKER.Initialize = function()

TestFrame = BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
BlzFrameSetAbsPoint(TestFrame, FRAMEPOINT_TOPLEFT, 0.424300, 0.393930)
BlzFrameSetAbsPoint(TestFrame, FRAMEPOINT_BOTTOMRIGHT, 0.458260, 0.362300)
BackdropTestFrame = BlzCreateFrameByType("BACKDROP", "BackdropTestFrame", TestFrame, "", 1)
BlzFrameSetAllPoints(BackdropTestFrame, TestFrame)
BlzFrameSetTexture(BackdropTestFrame, "none.blp", 0, true)
TriggerTestFrame = CreateTrigger()
BlzTriggerRegisterFrameEvent(TriggerTestFrame, TestFrame, FRAMEEVENT_CONTROL_CLICK)
TriggerAddAction(TriggerTestFrame, REFORGEDUIMAKER.TestFrameFunc)
end
i dont see where you are creating it
 
i dont see where you are creating it
You said;
you can create it properly by using this code

LUA
Code:
       new_Frame = BlzCreateFrameByType("SPRITE", "justAName", frame_owner, "WarCraftIIILogo", 0)
       BlzFrameSetPoint(new_Frame, FRAMEPOINT_BOTTOMLEFT, frame_relative, FRAMEPOINT_BOTTOMLEFT, 0.02, 0.02)
       BlzFrameSetSize(new_Frame, 1., 1.)
       BlzFrameSetScale(new_Frame, 1.)
       BlzFrameSetModel(new_Frame, "selecter1.mdx", 0)"

And I used that code to try to create the sprites, but failed. Now I am simply asking if you can show me how to use it correctly. I showed you what I have tried already. I'm attaching what I tried.
 

Attachments

  • SpriteAttempt.w3x
    21.6 KB · Views: 37
dude.. at least you should learn the basics of lua, you cant just insert bunch of code and expect it to work
Alright, well, if you're not even gonna try to say anything remotely useful then I guess I'm at a loss. Have a good day.

EDIT: I'm attaching a working example for anyone who wants to understand better exactly how to use this asset. I am a stern believer of examining already working/functioning examples to better understand how to create things by myself, but sadly not everyone shares this sentiment. I examined the example shown in Animated Model Frames to figure out how to properly initiate the sprite frames.
 

Attachments

  • Sprite Example.w3x
    21.4 KB · Views: 51
Last edited:
or you could just learn how to code to avoid this kind of problem, and honestly, any kind of problem with code
Everyone has got to start somewhere, and examining working code is a good way to learn. You'd probably spend way less time pointing me in the right direction rather than dicking around, and it would be a lot more constructive and educational. Instead you chose to spend time on pretentiously replying with useless, short one-liners.
 
right direction is to learn how to use code, which really solves any problem with code, it's pretty useless to teach people how to do abstract things when they dont understand the basics, next time they see new piece of code they will be lost once again, until someone do whole work for them, aaaand the circle made full spin

you learn not by examining the code, you learn when you actually write code and algorithms by yourself
 
right direction is to learn how to use code, which really solves any problem with code, it's pretty useless to teach people how to do abstract things when they dont understand the basics, next time they see new piece of code they will be lost once again, until someone do whole work for them, and the circle made full spin
Obviously you're wrong though, since I managed to get it working just fine from doing exactly what I said, inspecting a working example. So the next time I have a problem like this I know what to do, and how to solve it. Nobody "did the whole work for me" like you're suggesting, so stop attributing yourself stuff you didn't do.
 
what happens if the thing you want to do has no examples?
I'll research other methods? This is besides the point.

EDIT: You edited your post and added this;
you learn not by examining the code, you learn when you actually write code and algorithms by yourself
This is simply not true, you can learn a lot simply by examining working code. Breaking things down, and taking things apart to learn how they work is not only applicable when learning to code, but when learning pretty much anything.
 
because that way you dont learn actually
Um, yes you do? From examining code I learned that I need to make some form of global initiation for all functions in Lua if I want to call them with custom scripts. Again, see this;
This is simply not true, you can learn a lot simply by examining working code. Breaking things down, and taking things apart to learn how they work is not only applicable when learning to code, but when learning pretty much anything.

mashing pieces here and there not understanding how it's even working
Nice strawman argument there, since I didn't really "mash" pieces together here and there. I carefully read about what natives to use in common.j, used already working frames, and tried implementing your code into an already working environment. From there I took several specific actions to test your code to make it work, including defining parent frames and so on. My mistake was that I assumed all Lua scripts are automatically initialized, but I later came to learn that they in fact need to be manually initialized and called. So after all this I'd say I have a better understanding of how it works and how to solve similar problems in the future.

If you believe people don't learn by breaking things apart and examining them then you're out to lunch mate.
 
Top