Menu, character screen, game logic (o_Player)

U

UniqueLefou

Guest
Доброго времени суток, товарищи.


= GMS 2 =
использую и у меня возник такой "новичковый" вопрос.
Посмотрел приличное количество видеоуроков, касается Shawn Spalding и HeathBeast и не только, сделал с их помощью этот скелет, но, к сожалению, у них нет этой темы видеоуроков ( да и не особо есть подходящие другие видосы со старыми версиями и тд, к тому же, там просто делают экран выбора персонажа либо мультик делают, непонятно)

Здесь, к сожалению, тоже с основном старые темы 2010-13 годов да и не все мои вопросы там решены. :shooock:

(Мне нужна помощь в виде кода, если будут реализации дополнительного экрана выбора персонажа и правильного переноса логики.

[hr]

У меня уже есть меню, там две кнопки, прописаные кодом в (обьекте Мейн_Меню) - начало игры и выход - (продолжить игру я в принципе потом заменю настройками или просто удалю) или переделаю меню на другое -


1 Так вот, мне собственно нужна помощь = реализация экрана выбора персонажа - как это соорудить вместе со следующим вопросом.


2 Есть пока один играбельный персонаж (Обьект_Игрок), логика игры висит на родительских обьектах ((Хитбоксы, их срабатывание и общий лайтформ) -которые опять же взаимодействуют с (Обьект_Игрок))

Управление самостоятельно в виде вызываемого скрипта (Get_input), стамина и хп, прописаны в крейт-количество урона от атак, затрачиваемая стамина прописаны отдельно к нажатиям кнопок в степ эвенте (Обьекта_Игрок)

Интеллект врагов висит на нем (враги по логике преследуют и взаимодействуют с (Обьектом_Игрок)



[hr]
Нужно сделать так (если это возможно), чтобы после выбора персонажа осталась логика игры связаная с ((Обьектом_Игрок) логика хитбоксов, интеллект врагов) => УЖЕ на (Новых обьектах_бойцов)

Ну и чтобы я мог на каждый (Новый обьект бойца) прописывать другие статы, либо в крейт, либо степ (честно, я хз =D, нуб, что с меня взять) и так же вешать другие спрайты.




Как осуществить, создать или привязать на новых персов (Новые_обьекты бойцов) я хз (думал сделать дупликейт Обьекта_игрок но с другими спрайтами и показателями здоровья, атаки и тд, но тогда меняется имя обьекта и логика игры (хитбоксы, интеллект врагов) не работает.

Я чувствую, что близок, но не могу это правильно выразить и как связать это с меню выбора персонажа. Что то про общий контролер видел, но было упомянуто лишь в скользь.
Думал даже осуществить костыльный способ - при выборе персонажа => создается (Обьект_Игрок_2) - копировать всю логику и всех (обьектов_врагов2), которые будут тоже запускаться и взаимодействовать только с (Обьект_Игрок_2) а не (Обьект_Игрок_1) sm_sarcastic

Скрины уже написаного кода могу сделать и предоставить в эту студию, прост решил не засорять сразу тему

Мультиплеер :facepalm: планируется, но я скорее оставлю его напоследок, поскольку считаю достаточно сложной штукой для своих навыков и нормальной реализации.( Багодром делать не хочу))
хотя если найдется чел, который поможет с мультиком, то буду благодарен и буду готов помочь сам, чем смогу (Кстати,можете просто скинуть актуальные уроки по нетворку - тоже будет топ помощь)

Хоть я полазил на форуме, лазил в интернете, к сожалению , реально по этому вопросу я не могу уже какой день найти инфу понятную моему уже уставшему мозгу)




Good day, comrades.

[hr]

= GMS 2 =
I use it and I have such a "novice" question.
I looked at a decent number of video tutorials, as for Shawn Spalding and HeathBeast and not only, made with their help this skeleton, but, unfortunately, they do not have this topic of video tutorials ( and not particularly there are suitable other VIDOS with old versions, etc., besides, they just make the character selection screen or make a cartoon, it is unclear)

Here, unfortunately, also mostly old topics of 2010-13 years and not all my questions are resolved there. :shooock:

(I need help in the form of code if there are implementations of an additional character selection screen and proper logic transfer.

[hr]

I already have a menu, there are two buttons, spelled out by the code in (object Main_menu) - start the game and exit - (continue the game, I basically then replace the settings or just delete) or alter the menu to another -


1 So, I actually need help = implementation of the character selection screen - how to build it together with the next question.


2 There is still one playable character (Object_igrok), the logic of the game hangs on the parent objects ((Hitboxes, their operation and General lightform) - which again interact with (Object_igrok))

Management independently in the form of a called script (Get_input), stamina and HP, spelled out in the crate-the amount of damage from attacks, spent stamina spelled out separately to the button presses in the step event (Object_igrok)

Intelligence of enemies hanging on it (enemies, the logic of pursuing and interact with (Objektumok)



[hr]
We need to make sure (if possible) after the selection of the character remained the logic of the game associated with ((Objection) the logic of the hitboxes, enemy AI) => ALREADY on the (New objectable)

Ah and to I could on every (a New object of a fighter) prescribe other stats, either in crate, either step (honestly, I XS =D, noob, that with me take) and so same to hang up other sprites.




As implement, create or link on new Persians (Novye_obekty fighters) I Hz (thought do duplikeyt Obekta_igrok but with other sprites and indicators health, attacks and vast, but then is changing name of object and logic game (hitboksy, intelligence enemies) not works.

I feel like I'm close, but I can't put it right and how to link it to the character selection menu. Something about the General controller saw, but was mentioned only in passing.
Thought even implement a crutch way to - under choosing individual => created (Obekt_igrok_2) - copy entire logic and all (obektov_vragov2), which will, too, be launched and interact only with (Obekt_igrok_2) and not (Obekt_igrok_1) sm_sarcastic

Skriny already written code can do and provide in this Studio, but decided not to clog immediately subject

Multiplayer: facepalm: planned, but I would rather leave it for last, because I think it is quite a difficult thing for their skills and normal implementation.( Bagodra don't want to do))
although if there is a person who will help with the cartoon, then I will be grateful and I will be ready to help myself, than I can (by the Way, you can just throw off the actual lessons on the network - there will also be a top help)

Although I climbed on the forum, climbed on the Internet, unfortunately, really on this issue, I can not find any day to find the information clear to my already tired brain)
 
Last edited by a moderator:

SeraphSword

Member
If I understand the issue, you want to be able to swap out players on a character select screen, and have all the game logic work correctly with every character.

It seems like a state machine would do the trick. Create a state machine, where each state is one of your available characters.

As an example:
Code:
// This would be in the Create event, probably of your control object
enum characterState{
character1,
character2,
character3
}

// This would need to be in your Step event, or an an event that would run when you made your selection
switch (characterState)
{
   case character1:
      activeCharacter = Obekt_igrok;  // this might need to be the id of the specific instance rather than just the object
   case character2:
      activeCharacter = Obekt_vragov;
}
In this case, anywhere you have something that would interact with your character, use activeCharacter instead of the parent object.

Hopefully I understood the problem correctly. Even if it's not exactly what you're after, it might point you in the right direction.
 
Top