Okay, Just discovered something I thought I'd share. When it comes to portrait and having them hover over dialogs, it seems even after setting the render type to LDR, they don't always appear above the dialog as intended.
I wrote a function and tested this out and I found that whenever the portrait is created upon map initialization, It always seems to be rendered first, regardless of the order of declaration with the dialog. Unless it is done after map initialization.
For example:
Declare Dialog, Then Declare Portrait
At Initialization:
Result: The Portrait is under the Dialog
After Initialization:
Result: Portrait is above the dialog.
Posted some screenshots for proof.
If anyone else has findings that disagree with this, feel free to share them here. So far I haven't had any luck though.
Edit: Did some further testing.. Apparently It works If I create it as a separate thread, but not when I call it directly with custom script upon initialization.
Edit #2: Please note that this may only be applicable if you are coding in Galaxy. I recall when the same thing was atteptted with GUI triggers, there was no issue. It's too bad I don't like the way GUI triggers auto compile.
I write my code entirely in galaxy, no GUI triggers. Initializers are being used for these custom scripts, thus by default, they run at initialization. So yea, problem solved after splitting the load into multiple threads (which run during game launch).
I'm not going to make any assumptions, if you don't run certain segments code at initialization, when do you run them?
When you run something at 1 second elapsed time then you actually do something at map init, too.
The GUI trigger automatically adds a piece of script (almost the same as an initializer fuzzy was talking about) that creates your trigger at map init.
All triggers are created at map init, no matter what their events are. Also all variable initialization is done at map init.
When you run something at 1 second elapsed time then you actually do
something at map init, too.
The GUI trigger automatically adds a piece of script that creates your
trigger at map init.
All triggers are created at map init, no matter what their events are.
Also all variable initialization is done at map init.
Im not so sure about that. The variables may be initialized yes. But If i set it to = 1 I believe thats not done at map initialization.
Like he said. It acts differently with his portraites based on whether or not he runs it off the initialization event.
My point is I avoid running anything directly from the initialization event like its the plauge.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
//--------------------------------------------------------------------------------------------------// Global Variables//--------------------------------------------------------------------------------------------------intgv_someVariable;voidInitGlobals(){gv_someVariable=1;}//--------------------------------------------------------------------------------------------------// Trigger Initialization//--------------------------------------------------------------------------------------------------voidInitTriggers(){gt_someTrigger_Init();}//--------------------------------------------------------------------------------------------------// Map Initialization//--------------------------------------------------------------------------------------------------voidInitMap(){InitGlobals();InitTriggers();}
There you go :)
Copy-pasta directly from an empty map's script. That's all automatically created. InitMap() is called at map initialization (it doesn't need an event, it's always called automatically. It's the entry point of all triggers). InitGlobals() initializes global vars. And InitTriggers() - you guessed it - initializes triggers.
If you set a variable after initializing it it won't be called at map init of course.
You're right with your point, though. Usually I limit myself to creating triggers in initializers. Initializers are called even before Map Initialization events, and I know from experience that some things screw up.
so when my trigger uses Event time elapsed 1 second.... I could care less how the script actually initializes the trigger... im more concered about when my trigger is run.... and I know its gonna run after the game is loaded.... using the time elapsed event... considering that The time elapsed doesnt start ticking untill the game is loaded.....
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Script is nicer than GUI but so bare bones it's painful at times. Imagine if script had auto completion, meaningful namespaces and on the fly syntax checking! (lets hope Andromeda and the custom editors deliver)
With script you can initialize all your triggers and variables after map init (well most of them).
Script is nicer than GUI but so bare bones it's painful at times. Imagine if script had auto completion, meaningful namespaces and on the fly syntax checking! (lets hope Andromeda and the custom editors deliver)
I basically dont bother using script because it is missing those features. IMO script really isnt nicer then the GUI, though doing simple things may seem like it takes longer (because you have to click through lists.. but thats wht the search line if for i find stuff pretty quick in there these days), but really I can write triggers in GUI faster then in script, because I know I dont have to worry about syntax errors. Using a thrid party tool to write script then have to copy it in doesnt save time in my book.
With script you can initialize all your triggers and variables after map init (well most of them).
Even if you use GUI .... it is all "initialized at map load".... it has to be or you wouldnt be able to access these data objects
Now if your using script I believe it is possible to initialize on the fly durring run time... such as creating new triggers with new events... possibly even new variables.... from my understanding that is the only advantage to using script.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
I'd say the main thing i hate about GUI is when you press ctrl+f11, the generated script is very inefficient. Galaxy provides the extra degree of control as it lets you play with the structure of the code. Also, generated script variables and function names suck.
In the end, everyone has their preferences.
I personally prefer Galaxy as its much faster when you're used to it (I need the speed cos I don't have much free time to work on maps). One good example would be if i wanted to assign the value 10 to an integer i.
In GUI, you'd have to click select the variable, assign the value etc. that would take say 10 seconds for an experienced GUI triggerer. Mostly because alot of time is wasted clicking and searching.
In Galaxy, its as simple as "int i = 10;"
Another example: Function creation.
GUI: Right click, new function, assign parameters etc etc etc. - At least a minute.
Galaxy: void blabla(int i, int j, int k){ Code here. } - Takes less than 10 seconds.
That so? I honestly had no idea. Do you mean to say if render priority is set after everything is created, the portrait would appear infront of everything else?
I noticed something else... When you change the model of the portrait, you need to reset the render priority it appears behind the dialogs again.
Render priority can be applied to any dialog objects with int for 0 -> 225 , which ever got first depends on the order they were created, you can change it later
If I'm not mistaken, That option only exists for dialog items. Portraits have only LDR or HDR render types(?) So I don't think they're the same thing?
With HDR render priority, there are lights on the portrait (glowing eyes etc) with LDR, you don't.
awesome sauce. I swear I learn something new about Galaxy every day. Thanks for the tip :D So say I want my portrait to be sandwiched between dialog A and B, all I'd have to do is have the channels set as follows:
Hey.. I just tried this.. It doesn't seem to work.. Maybe its Exclusive to portraits and dialogs? IE.. the layering compares portraits with portraits and dialogs to dialogs but not dialogs <-> portraits?... i tried setting the channel to 0 and 1 and 1 and 0 respectively, the dialog always appears on top.. god damn this is annoying..
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Okay, Just discovered something I thought I'd share. When it comes to portrait and having them hover over dialogs, it seems even after setting the render type to LDR, they don't always appear above the dialog as intended.
I wrote a function and tested this out and I found that whenever the portrait is created upon map initialization, It always seems to be rendered first, regardless of the order of declaration with the dialog. Unless it is done after map initialization.
For example:
At Initialization:
After Initialization:
Posted some screenshots for proof.
If anyone else has findings that disagree with this, feel free to share them here. So far I haven't had any luck though.
Edit: Did some further testing.. Apparently It works If I create it as a separate thread, but not when I call it directly with custom script upon initialization.
Edit #2: Please note that this may only be applicable if you are coding in Galaxy. I recall when the same thing was atteptted with GUI triggers, there was no issue. It's too bad I don't like the way GUI triggers auto compile.
after looks better to me.
Why are you creating anything at initization in the first place?
@SouLCarveRR: Go
I write my code entirely in galaxy, no GUI triggers. Initializers are being used for these custom scripts, thus by default, they run at initialization. So yea, problem solved after splitting the load into multiple threads (which run during game launch).
I'm not going to make any assumptions, if you don't run certain segments code at initialization, when do you run them?
Whether you use Scirpt or GUI doesnt make a difference they are the same thing.
I dont run any thing on Initialization, because it causes errors in a lot of cases.
I run them On time elapsed 1 second.
Most my stuff I create a "game start" trigger which I run after doing my own "setup sequences"
This is kinda a carry over from Wc3 for me ... I learned early to never use map initialization event lol or well ... to just avoid it
I know for certain things that "map initialization" prolly has benefits... but for custom maps it really shouldnt make a difference.
@SouLCarveRR: Go
When you run something at 1 second elapsed time then you actually do something at map init, too.
The GUI trigger automatically adds a piece of script (almost the same as an initializer fuzzy was talking about) that creates your trigger at map init.
All triggers are created at map init, no matter what their events are. Also all variable initialization is done at map init.
Im not so sure about that. The variables may be initialized yes. But If i set it to = 1 I believe thats not done at map initialization.
Like he said. It acts differently with his portraites based on whether or not he runs it off the initialization event.
My point is I avoid running anything directly from the initialization event like its the plauge.
There you go :)
Copy-pasta directly from an empty map's script. That's all automatically created. InitMap() is called at map initialization (it doesn't need an event, it's always called automatically. It's the entry point of all triggers). InitGlobals() initializes global vars. And InitTriggers() - you guessed it - initializes triggers.
If you set a variable after initializing it it won't be called at map init of course.
You're right with your point, though. Usually I limit myself to creating triggers in initializers. Initializers are called even before Map Initialization events, and I know from experience that some things screw up.
Yeah ... I dont use script at all..
so when my trigger uses Event time elapsed 1 second.... I could care less how the script actually initializes the trigger... im more concered about when my trigger is run.... and I know its gonna run after the game is loaded.... using the time elapsed event... considering that The time elapsed doesnt start ticking untill the game is loaded.....
Script is nicer than GUI but so bare bones it's painful at times. Imagine if script had auto completion, meaningful namespaces and on the fly syntax checking! (lets hope Andromeda and the custom editors deliver)
With script you can initialize all your triggers and variables after map init (well most of them).
@SouLCarveRR: Go
I'd say the main thing i hate about GUI is when you press ctrl+f11, the generated script is very inefficient. Galaxy provides the extra degree of control as it lets you play with the structure of the code. Also, generated script variables and function names suck.
In the end, everyone has their preferences.
I personally prefer Galaxy as its much faster when you're used to it (I need the speed cos I don't have much free time to work on maps). One good example would be if i wanted to assign the value 10 to an integer i.
In GUI, you'd have to click select the variable, assign the value etc. that would take say 10 seconds for an experienced GUI triggerer. Mostly because alot of time is wasted clicking and searching.
In Galaxy, its as simple as "int i = 10;"
Another example: Function creation.
GUI: Right click, new function, assign parameters etc etc etc. - At least a minute.
Galaxy: void blabla(int i, int j, int k){ Code here. } - Takes less than 10 seconds.
How is this anything different ? You can always set render priority and make smt float infront of the others in real time ?
@progammer: Go
That so? I honestly had no idea. Do you mean to say if render priority is set after everything is created, the portrait would appear infront of everything else?
I noticed something else... When you change the model of the portrait, you need to reset the render priority it appears behind the dialogs again.
@FuzzYD: Go
Render priority can be applied to any dialog objects with int for 0 -> 225 , which ever got first depends on the order they were created, you can change it later
@progammer: Go
If I'm not mistaken, That option only exists for dialog items. Portraits have only LDR or HDR render types(?) So I don't think they're the same thing? With HDR render priority, there are lights on the portrait (glowing eyes etc) with LDR, you don't.
@FuzzYD: Go
It does, the same way as dialog item, called RTT (render to texture):
PortraitSetChannel((PortraitLastCreated()), 1)
And this is dialog item:
DialogSetChannel((DialogLastCreated()), channel)
@progammer: Go
awesome sauce. I swear I learn something new about Galaxy every day. Thanks for the tip :D So say I want my portrait to be sandwiched between dialog A and B, all I'd have to do is have the channels set as follows:
Right?
@progammer: Go
Hey.. I just tried this.. It doesn't seem to work.. Maybe its Exclusive to portraits and dialogs? IE.. the layering compares portraits with portraits and dialogs to dialogs but not dialogs <-> portraits?... i tried setting the channel to 0 and 1 and 1 and 0 respectively, the dialog always appears on top.. god damn this is annoying..