Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - tzachs

#21
Quote from: cat on Sun 21/07/2019 19:41:50
(how would I go about climb animation anyway?)

An outfit is just a map from a string key to a directional animation, and you can add any animation you want, so you can do for example:
Code: csharp

var clarkKentClimb = _game.Factory.Graphics.GetDirectionalAnimation(_baseFolder, "CK/Climb/Left", "CK/Climb/Right", "CK/Climb/Down", "CK/Climb/Up");
clarkKentOutfit["Climb"] = clarkKentClimb;

var supermanClimb = _game.Factory.Graphics.GetDirectionalAnimation(_baseFolder, "Superman/Climb/Left"); //no budget to animate all dirs, the left animation will always be used
supermanOutfit["Climb"] = supermanClimb;

//Then, when you want to animate:
_character.Outfit = supermanOutfit;
_character.StartAnimation(_character.Outfit["Climb"].Down);

...
_character.Outfit = clarkKentOutfit; //With the new addition, if superman was still climbing when changing the outfit, clark kent will be climbing now as the climb animation exists for it as well (and I guess if the climb animation doesn't exist, I'll rollback to the idle animation, and if the idle animation doesn't exist, I'll do nothing)


(But an animation doesn't have to be associated with an outfit, you can also start an animation directly).
#22
I'm still not completely convinced (if you set an outfit while the character is walking, won't you expect the new outfit to also change to walking, and not idle, for example?), but as you represent 100% of the user-base you get what you want.  (nod)
I'll make the change soon.
#23
Hmm, you can start the idle animation yourself after setting the outfit with something like this:

Code: csharp

_character.StartAnimation(_character.Outfit[AGSOutfit.Idle].Down);


Or instead, I think just calling face direction should work as well.

I can make it automatic, but then what if somebody doesn't want to start the idle animation in the new outfit? What if they want to continue the same animation from the previous outfit? But if we go down that route, then what do we do if there is no equivalent animation in the new outfit to match the old outfit?
As a more powerful example, I can imagine a scenario of a "falling from the skies Clark Kent" who wants to switch to "flying Superman": now, I do have a "falling" animation for superman but I don't want to switch to it, I want to switch to "flying" in the new outfit -> the engine doesn't have a way to know that, so I think having it as a two step process (i.e first select the outfit, then select the animation) is cleaner.
But I'm open to suggestions on how to make this more friendly.
#24
The purpose of "Remember" was for the save system, and I don't know if it will be kept in the same way after I'll rewrite it.
The main reason for this is that you're creating the character into your own class variable, i.e it's not part of the state, so we don't have a way to load it automatically ("Remember" is just you passing a function to the engine that's called after loading a game to allow you to assign it to your variable again).
Anyway, it's only intended for the initial object creation (i.e this code will only usually be in the editor generated code, you won't need to touch it at all in your own code), you don't need it for changing an outfit, you just need to do:

Code: csharp

_character.Outfit = myOutfit;

#25
If you're on Windows 10, then in their latest version they've added the "Windows subsystem for linux" which saves you the need to install your own virtual machine.
You can just grab ubuntu directly from the windows store: https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6#activetab=pivot:overviewtab
#26
Advanced Technical Forum / Re: SKEW Code
Fri 07/06/2019 05:07:39
Inkscape has a "skew" feature, I think their code for that is here, if that helps: https://gitlab.com/inkscape/inkscape/blob/master/src/ui/tool/transform-handle-set.cpp#L510
#27
The bug happened whenever you started the walk after the character started talking AND it was still walking when done talking. So maybe the walk you do when you place the character yourself was shorter and ended before you were done talking, otherwise I have no explanation.
Anyway, good that it's solved, I merged it to master (and I think that covers all of your reported issues, let me know if I forgot something).
And good luck with MAGS  :)
#28
Quote from: cat on Sun 28/04/2019 20:25:55
Now, when I click somewhere on the screen while the cat is talking, it will immediately slide to the clicked position without walk animation being played.
I pushed a fix here, can you test to see that it solved the issue for you?
Thanks.
#29
Quote from: cat on Sun 05/05/2019 14:32:03
How would hide the constructors? Make them internal?
Yes.

Quote from: cat on Sun 05/05/2019 14:32:03
How does the factory pattern work anyway in connection with autofac dependency injection? When do you use what?
The factory holds the resolver inside of it, and uses it to resolve dependencies (example).
As a user of the engine, you should be using factories to create stuff, and only use the resolver directly when you want to inject stuff (i.e if you find yourself in the need to use the resolver to resolve something, it might be a sign of a missing factory).

Quote from: cat on Sun 05/05/2019 17:41:34
Good news - I was able to code the dialog tree for the puzzle :)
;-D

Quote from: cat on Sun 05/05/2019 17:41:34
However, the question above is still valid: what is best practise for dialogs?
Hmm, one reason to break things up is for debugging: each dialog action can be disabled separately (dialogAction.Enabled = false), so, for example, you can do a single action with all of the talking and another action for giving an inventory item, and then you can disable the talking when you're testing stuff.
Other than that, I added single actions mostly planning for the editor, but no reason to use them if you're using the engine directly (and for the editor I'll probably change how it's written now anyway, I want to combine the current dialog actions with general visual scripting when I get around to adding it to the editor, as it's basically the same thing).
#30
Quote from: cat on Sat 04/05/2019 14:39:14
I just wonder why a new config object would yield right-aligned text...
That's because I've set the defaults for the text config creation in the factory method (factory.Fonts.GetTextConfig) and not in the object itself. I'm leaning into eventually providing factory methods for generating everything instead of using constructors for the object directly, for several reasons:
1. Discoverability- you'll be able to browse the factories, and just with the help of code completion and nothing else you'll be able to see everything you can create.
2. Consistency- every time you need to create something, you'll know that you need to find a factory for it.
3. Context- The object might need information that will not be "easy" for the user to pass if using the constructor. For example, we might add a general default text config object like I have just done for the dialogs, in that case the AGSTextConfig constructor will need access to that default object -> the factory method will have that context and do it for you so you won't have to figure it out for yourself...
4. Injection- by using the factory you'll be able to inject your own factory (or a plugin author's factory) with different behaviors than those built in in the engine.

Anyway, for now I pushed a fix to have defaults for AGSTextConfig to match the defaults for the factory method, but not sure if in the future we'll want to continue exposing those constructors.

Quote from: cat on Sat 04/05/2019 14:39:14
I hope all my bug reports are not too frustrating  (roll)
Not at all, I live for this! (just realized that sounds sad).
#31
I pushed the fixes to the PR.

One breaking change: defaults.TextFont and defaults.SpeechFont changed to defaults.Fonts.Text and defaults.Fonts.Speech.
I also added defaults.Fonts.Dialog (which you can leave blank to use the text font), and also a default section for dialogs (defaults.Dialog) in which you can set stuff like colors, for example to change the color of hovered dialog options to green:

Code: csharp

game.Settings.Defaults.Dialog.Hovered.Brush = game.Factory.Graphics.Brushes.LoadSolidBrush(Colors.Green);


I also added a dialog rendering layer which by default sits in front of the UI and behind the speech (and you can override it in the defaults.Dialog section as well).
#32
Right, another thing to fix (forgot to put the black box on the same layer as the dialog options).
I'll add the fix to the PR, but in the meantime, you can do:

Code: csharp

var dialog = factory.GetDialog(...);
dialog.Graphics.RenderLayer = AGSLayers.UI;
#33
Right. Ideally I would like you to be able to set defaults for everything, i.e the default settings in which you set the default text & speech fonts should also have a section for dialogs where you can set default colors, default render layer, etc (maybe I'll just add it for this PR, it's pretty simple).

As for hooks, you can either, like you said, override IDialogLayout and make changes to dialog options there, or you can override IDialogFactory and create your own dialog & dialog options.

And yes, it's possible to use graphics for dialog options:
Code: csharp

var option = factory.GetDialogOption("Hello!");
option.Label.Image = myImage; 

//and label has all of the regular object's components, so you can also do:
option.Label.StartAnimation(myAnimation);
option.Label.TweenY(...); //etc
#34
Quote from: cat on Wed 01/05/2019 12:24:49
Would it be possible to change the Z-order of the dialog itself but keeping it in the UI Layer?
Yes, this should do the trick:
Code: csharp

var dialog = factory.GetDialog(...);
dialog.Graphics.Z = 50;


Quote from: cat on Wed 01/05/2019 12:24:49
One more question: In the start-up logic of the game, I set game.Settings.Defaults.SpeechFont and TextFont to a custom font. This works very well for spoken text as well as the "Loading" label of AGSSplashScreen, but it doesn't work for the dialog options. They are tiny (remember, the game is high-res) and with a different font. Would it be possible to use the TextFont there?
Ah, right, I missed that.
It should be fixed in this branch: https://github.com/tzachshabtay/MonoAGS/pull/316
Do you want to test it before I merge to master?
#35
Ah, good catch.
I've put the dialogs on the same layer as the GUIs by default, so they can be behind other GUIs. I'll change the default and put them in their own layer.

Meanwhile, you can change the layer for your stage to be behind other GUIs (but still in front of room objects):
Code: csharp

stage.RenderLayer = new AGSRenderLayer(AGSLayers.UI.Z + 1);
#36
Yes, and I think it can maybe go hand-in-hand with the "time machine" feature we once discussed: i.e a group of entities are assigned to a specific "time machine" (your "control layer") which then allows you to slow down/speed up time, rewind, forward and pause, whereas pause is the same pause that you were talking about (pausing time will also effectively block inputs).
#37
Quote from: cat on Mon 29/04/2019 08:49:19
Does this mean I have to disable the character everytime I have a cutscene? With AGS, talking was blocking, so noone could walk around during a scripted dialog scene.
Right, I didn't want to disable the player automatically for every event handling, because I wanted to allow writing "responsive cutscenes" (which is not always trivial to do with AGS).
The plan is for the editor to (by default) automatically inject disabling/enabling the player when handling events (along with starting/ending a cutscene and hiding/changing the mouse cursor).

Quote from: cat on Mon 29/04/2019 08:49:19
Didn't you build something that disables walking while talking?

Edit: I found the post I was talking about: https://www.adventuregamestudio.co.uk/forums/index.php?topic=56055.msg636597241#msg636597241
Right, hence the "i'll look into that"  :)
#38
This looks very impressive, well done!
Any plans on open sourcing it (or, are you going the commercial route)?
#39
Quote from: cat on Sun 28/04/2019 20:25:55
Finally some more MonoAGS!
Hooray!  ;-D

Quote from: cat on Sun 28/04/2019 20:25:55Now, when I click somewhere on the screen while the cat is talking, it will immediately slide to the clicked position without walk animation being played.
Hmm, I'll look into that.
But, do you even want to allow walking the cat during the cutscene? Because if you don't, you can put "Characters.Cornelius.Enabled = false;" at the beginning of the scene (and "Characters.Cornelius.Enabled = true" when you want to return control to the player).

Also, slightly off-topic, but you can wrap your cutscene with "game.State.Cutscene.Start()" and "game.State.Cutscene.End()" in order to allow the player to skip the scene (how the player can trigger skipping the scene is controlled with "game.State.Custcene.SkipTrigger").

Quote from: cat on Sun 28/04/2019 20:25:55
And another question: You probably have told me already, but how does setting an object's baseline work? I didn't find a baseline property.
The short answer is that the Z property is the object's baseline (and by default, unless you explicitly set Z, Z will equal Y).

The longer answer is that the order in which objects render first depends on their render layer. For example, by default, all GUIs are created in a separate layer than room objects, and as the GUIs layer has a lower Z than the object layer, all guis will appear in front of all room objects, even if their individual Z says otherwise.
In other words, the object's Z is compared only for objects in the same render layer.
Also, you can add a Z offset for individual sprites, those are added to the object's Z when the comparison is made. So if you have an animation for an object in which you need one of the frames to appear behind something, you can give that specific frame an individual Z offset to make that happen.
And lastly, if you use object composition (i.e Cornelius the cat might have a gun as a separate object and that gun has the cat as its parent), then the children objects will only be compared against themselves, and will use their parents for comparing against other objects.
#40
Yes, I meant we booked our flights to Israel.

Quote from: tzachs on Thu 24/01/2019 00:11:24
We can do Europe, either in the beginning or end of August (we'll be in Israel mid august).
SMF spam blocked by CleanTalk