I wonder how to make one random player from all the players in the lobby an impostor
I am working on a game that is somewhat similar to the idea of Among Us and what has been hindering the completion of this game is that I cannot set a random player as an impostor among the players so that I can add special features to him like increasing his speed and others
But when I put the action “Select Random Object” and select the player, what do I do next? I have a global variable called (ImposterID) but how can I combine it with the randomness and how can I select a random player from the players in the lobby as an impostor?
Sorry but I’m very new to the multiplayer part… so my questions might seem illogical to you ):
Can you please tell me how to do this easier?
Problem i am not into multiplayer
I have no idea how it works
I just know what you need to do from logic side
So your player objects are duplicates of same object
And then you simply pick one of them with that pick random object action
OR you have them as being each separate objects
Then in editor you need to put them into the group fro example called Players
And now you use pick random object Players
And i would do it right before game starts i mean when players go from loby to actual game
And now all you need is one condition
Player variable Impostor = TRUE
And under that even you shove in all your logic for what impostor can and should do and what he would see
Maybe he would have different interface?
And your global variable ImposterID makes no sense
Since it is global and it is only 1 var
Then if it is true or false when it is boolean
What it would indicate or influence?
I think you lack a lot of knowledge and you should watch some tutorials before you get into game making
Do not give up on your game
I only say gain some knowledge then go for it
hum…Maybe what you need is a group of Players. Do you have one?
Try creating slightly different ducks (change a color for example) and put all your different characters in a group. (I realise just now : Zero X4 just said the same).
I think this is a little harsh though : one has to know what to look for in a tutorial to really learn I think and now that you’ve helped and given clues, OP can go look by himself!
When someone asks questions how to solve some simple logic
Admitting at the same time he is new
For sure he have not enough knowledge to complete a game
Where i did not forbid him from making this mistake
I only gave advice
Next time you quote me better quote whole sentence
So you do not change meaning of it
I think you lack a lot of knowledge and you should watch some tutorials before you get into game making
Do not give up on your game
I only say gain some knowledge then go for it
Nevermind…I didn’t mean to start a pointless argument.
At the least, your wording isn’t really clear : “before you get into game making” and the end of your message(which is a new sentence by the way) seem contradictory but that’s maybe why i’m bad at programming…i’m not the most logical person around.
On one hand i wonder how you came to conclusions that any1 who come here to help care to be harsh or mean to others?
On other hand just because i need to ask you such question kinda explains that you get from my message what you want instead of trying to understand it
While at the same time think why i even wrote what i wrote?
I joined gdevelop over 2 years a go to simply recreate MINIcraft which is game jam game which lead to developing MINEcraft
And someone ported it even to gba
I kinda NOW TODAY have everything i need to recreate this game in gdevelop
BUT some parts would be figuring out rather than knowing how to do
For example i more or less know how to make chunk system and split world into grid yet i never done that
I need to explore that logic before i can move on with it
And that is because i came here with same believe as OP i gonna make a game
I did lack knowledge to even properly create player movement
Tutorials did help
And look where i am now over 2 years later?
Are you able to play my recreation of it?
I can make part of it
But FROM MY OWN EXPERIENCE
When you need to ask questions how to do something so simple
You will fail at more complex logic
And i experienced it 1st hand
And i wish i could save every single fresh dev from realizing same thing as i did and giving up
So my words were only in best interest of OP
What you took out of it indicate you are looking for conflict and not for solution
So stating now you did not want to start pointless argument makes no sense
Anyway i have no harsh feelings but just like in OP case
I am trying to explain something to you and not humiliate you
So take it as me trying to help
I help however i can and how i see fit
If you have any other words to say to OP to motivate him to gain more knowledge go with it i will 100% back you up on it
I am not diminishing your experience
I simply feel you are in same shiet i was
And nothing will help you more than getting more knowledge
Where main idea is not to just gain knowledge
You need to gain some practice
like imagine you work in pharmacy
You sell medicines
Your knowledge is when my head hurts i ask you for something to cure me
YOU knowing exactly which medicine to sell me is your knowledge
Practice is to know where that medicine is located on 100 shelves in your pharmacy
So, did you have a chance to work on your project?
If I may help and go the same route as ZeroX4 : I’m not an expert so I may make mistakes but here is how I would approach it :
Create 3 other characters.
Create a group and add the 4 characters in it.
For each Character object, create a variable is_impostor (boolean), False as a default value
In you event sheet : select a random object among the group Player, at the beginning of the game.
turn the random selected player’s variable is_imposter to True.
Thanks to your help, I was able to set a random player as an impostor
Actually, when @ZeroX4 explained it, I understood it and applied it literally and his explanation made me understand the logic of GDevelop… But what didn’t work properly is that I didn’t notice that I had to set (Trigger once) I was setting it (at the beginning of the scene) and this is a mistake that I didn’t notice until @Marraw shared the explanation with me
But I have an additional problem after setting a random player as an impostor
Honestly, I no longer understand if it’s me or if multiplayer affects GDevelop’s logic because this is not the first game I’ve created on GDevelop but it’s the first experience with multiplayer and it’s complicated in terms of variables
Since this is what I’ve done now, it sets a random player as an impostor as I explained to Me:
This is my experiment to make sure it randomly assigns a player as an impostor and differentiates between players in this development environment, I made its transparency 20% and it actually works and assigns a random player as an impostor and I can see the transparency applied successfully which means its assignment process is done
Currently, the game is supposed to be somewhat similar to Among Us, where the impostor should be able to kill other players, for example, when doing events and actions like the following, it is applied to the impostor, which is normal because I assigned this ability to the impostor, so my question is, how can I assign perks like killing and others to the impostor and make it affect the player Normal
That is something i cannot assist you with
I am not into multiplayer and i don’t know anything about it
There is multiplayer help channel on gdevelop discord
Maybe try asking there
Hey! Glad you could make it work!
hummm I’m experimenting with multiplayer too and from what I understand the central notion is “ownership”.
Without a bigger view at your events, it’s a bit difficult to guess but maybe try with this as an event and adding your collision event as a subevent under it :
You can try narrowing the problem down with viewer conditions : perhaps start by removing the x key pressed condition.
Furthermore, I’m not sure any peer has a right (ownership/authority) to delete any player. So maybe your imposter will have to take ownership of the object it “wants” to kill/delete.
That’s what I can think of now, but you’ll have to test things out!
Hey! I’ve worked a bit on your problem and i came up with a half solution…I’ll post it when I’ll be on my computer!
The player gets deleted on collision but i can’t make it work yet with a Key press évent…
but as I said, it’s only a half solution, whenever and wherever I put the key pressed condition, it stops working…
So, for now, when the imposter collides with another player, the latter is deleted.
Maybe someone will be able to help us!
EDIT : the repeat condition is only for debugging purposes! It’s not necessary at all!
EDIT : when I say it stops working, what I mean is : the conditions are all checked OK (I can see the debug messages : “collision registered” and “collision registered : with killer” in the log) but I don’t get past the last conditions…