BAOBAO
edited April 2023 in General Support
As I noticed, working with schematics has its own problems. For example, if I wrote this not as a schematic, but as a script, then I would insert a variable depending on the total number of groups. Thus making the script automatic. But making a schematic, as I understand it, I have to duplicate the nodes as many times as I can have the maximum number of groups. Do I understand correctly that there is no other option or am I missing something?
image
Post edited by BAO on
  • I assume this is for the same functionality we talked about in the other topic (sending groups)?

    You don't need to create new player groups each time - you can e.g. just create them at the start of your game and move combatants between them.
    E.g. the Group menu part can also transfer combatants between player groups to let the player select them that way.

    Otherwise, yes, using schematics is doing it this way. Naturally, via scripting you'll always be a lot faster if you know what you're doing :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • BAOBAO
    edited April 2023
    >I assume this is for the same functionality we talked about in the other topic (sending groups)?

    This is true. And this is just the beginning of my many questions) I really like the Toolkit, but a small number of learning resources makes me annoy people with questions on the forum and in the discord. Since you are literally the only one here answering questions, should I create new topics or can we all discuss in one?

    At first I thought to implement everything in the concept that they are all one group. And the difference in their state group (reserve, battle) would determine their state on the map. Since at first I didn’t want their numbering to constantly hang out (the robber under button 1 after leaving the group and returning would take the last place, and the number would change)

    Yes. I made it so that the hotkey is essentially tied not to the character, but to the position of the group index.

    Then I decided that this is actually a good design, that the numbering is changing. F1-F6 will be used for groups respectively, while the numbers 1-10 will be used to single out combatants and create new groups. This solves the problem of the lack of numbers (in fact, the maximum number of combatants is 16, not 10 as I wrote earlier)

    So I made the active group on the map an ally. I can't say how much it works yet, since I only learned how to spawn and detach from the group.

    Let me take this opportunity to ask you the following questions:

    1) Will I have problems reordering the group? For example, I want the returning party to occupy not the last numbers, but the first ones. At the same time, starting from 1, since under 0 is a hidden caravan combatant.

    2) Ah, that is, groups can exist without a combatant inside? I noticed that it is possible to create an empty player group. But when it comes not to the player's group, then I did not see an option. However, if you just write a group join without declaring a group, it still seems to create a group. In that case, how can you contact her? How to write non player group ID(if he ever exist) in the selected data?

    3) What do you think is the best way for me to control which group returned and which data to clear? For now, I'm implementing it so that each combatant has a status value of a group id, and when they return, it simply reads from their status and clears the group based on that.

    I also implemented the hotkey selection of the hud bar in this way. I couldn't use native bool "Is choosing". Therefore, I created a simply pseudo-boolean status value that can be either 0 or 1, which is called is "global_map_selected".

    I also made another crutch. To understand which next group to fill, I can’t just use a variable + 1, since I didn’t find the switch function. (As well as I can’t create groups with a specific id using a variable), I took a selected data, and if the group is created, I create absolutely unnecessary empty object and put it in the selected data. So checking which group is next goes through the check selector data count, who is filled by empty objects

    I used this method because I'm not fully familiar with the framework and the unity, so I haven't gotten into scripting and combining ork with self-written scripts yet. Or is there some other easy way to quickly create variables for combatants/objects using the framework?


    4) I'm having trouble with the move ai (two pictures are attached) Using raycast, I find vector 3, recheck by creating an empty object. After that I pass vector3 to the waypoint ai set and nothing happens. Also tried target ai. Nothing. All I want to achieve is for now just send him to some position
    EDIT:I made a mistake. I thought the movement should be implemented through the move ai. but i just did it through change position node. imageimage
    Post edited by BAO on
  • We can discuss it all in one topic :)

    1) No - the Group menu screen part even allows you to reorder them as you like :)
    Just one thing to keep in mind, the first member (index 0) is usually considered the player, though e.g. having a hidden 'caravan' as the player will work around that (like the Princess in the 2D Grid Battle RPG tutorials).

    2) Yeah, if a player group for the ID doesn't exist, it'll be created when adding combatants to it.
    A combatant is always part of a group, so creating a combatant without a group or setting the group to null will create a new group just for that combatant (of the first faction in the faction list).
    You can get a player group for an ID like this:
    Group group = ORK.Game.PlayerHandler.GetGroup(groupID);

    3) Since the combatants return to the caravan physically, you can probably handle that just via the game object's combatant. I.e. similar to them starting whatever they do at their destination, coming back to the caravan can start something there and just put all the combatants from the group back to the player group.

    Otherwise, remembering group ID can also be handled via object variables on the combatants.
    Next update will also change some of the player group nodes to use value selection fields instead of the fixed defined value (i.e. like the Join Group node already does).

    4) Alternatively, you can also use NavMesh agents and set a destination using a NavMesh Destination node.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • BAOBAO
    edited April 2023
    >3) Since the combatants return to the caravan physically, you can probably handle that just via the game object's combatant. I.e. similar to them starting whatever they do at their destination, coming back to the caravan can start something there and just put all the combatants from the group back to the player group.

    Yes, I want to do something similar. All objects that can be interacted with have a trigger machine by tag. And all combatants will have a group tag

    (better to use interactive machine, cause all interact mean hud menu before interaction. But just now i training on triggers)
    Post edited by BAO on
  • Look at this:
    The problem. I want to rotate the huds so that they look like cards. But the problem is that when I give them the rotation to the ONE point, they all rotate by the ONE degree, which they shouldn't. I suggested that the transform is taken not by the position of the HUD, but by something else. Because it seems that the transform that is taken from each HUDS is the same. Except the last
    imageimageimageimage
  • everything works correctly if the layout type is not a circle. (as you can see they are all at one point)image
  • I realized my mistake. In fact they all rotate uniquely the way they should, just a position in the world. However, I did not find any way to change the rotation for UI. There is no check for changing the rotation in the rect transform UI.
  • Is there any way I can view the objects inside the selected data??

    How can I access existing nodes? I mean, I'd like to tweak them a bit and see how they work internally.
  • Rotating via Transform is the same as RectTransform, so regular rotation nodes work for UI. So, rotating Selected Data with local data key ui in schematics used by UI boxes or HUDs should work.

    There's a HUD Selected Data List component available to list selected data content in a HUD, otherwise there's no real way to show what's in selected data.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • In all the boxes that we have created, there is always an empty text object. As I understand it, it defines the standard dimensions of the layout element inside the box.

    But the questions are: is it possible to make him read several texts? They just suggested to me that it is possible to create objects with an element layout component, and thereby create custom spots on which the UI will be located.image
  • You can set up Additional Content on the UI box to have multiple texts. The content is identified by it's Content ID, e.g. a dialogue showing additional content needs to use the same content ID to show the text there.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • BAOBAO
    edited April 2023
    As I understand it, the original decision to make the display through the HUD was unsuccessful. Since you need to make it so that the player can interact with a mouse click.
    In that case, I went to the screen menu and ended up making a thin one through the menu so that I could click and thereby swap.
    My question was related to the fact that I wanted to make a HUD in the style of a card layout. And I did not understand how to do this at all, since I am a beginner and did not even fully know how the Unity UI works. I thought about manually positioning the elements in the Content object (which is what I asked), and I thought about just changing their positions through the schematic. And then I remembered that I have scripts, and just in the initialization of each game object, I wrote down its position and rotation.

    It worked out well.
    image
    But the problem is how sorting works in a group. It works exactly like sorting, but there is no position change. I'll explain with a picture.

    image


    So far I don't know how to solve it.
    Post edited by BAO on
  • It seems I understood the logic of actions.

    Select Schematic

    Write a schematic, a very simple schematic that just takes the combatant id and feeds it into a script and runs it.

    The script looks like this:
    It has two variables. Both are for the ID combatant.

    Each time call it writes to a variable. When the second variable is filled, code is executed that finds the positions in the player group list of both ID combatants and simply swaps them.

    But the problem is that I don't understand how to approach this at all.

    How can I access the combatant ID? I know that you can use the local ui to access the ui that the schematic called. But how do you get access to the contents of ui?

    How to call a script using a node I found in this topic. I'll try later.

    https://forum.orkframework.com/discussion/2371/call-script-from-event
  • edited April 2023
    The HUD Click component can be used to do things when clicking on a HUD.
    Otherwise, Animation Machine components can be started e.g. by buttons added to your HUD and do something using schematics.

    You can get the ID of a combatant in schematics using selected data. First, store the combatant into selected data (Select Combatant node) and use the Store Selected Data ID node to store the ID/index into an int variable.
    Alternatively, you can also store the combatant into global selected data and directly access it from there (can be accessed via Maki.Game.SelectedData, similar to global variables at Maki.Game.Variables).
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.