Why doesn't kbIsPlayerHuman() work for rm scripts?
- RevarloVlabius
- Crossbow
- Posts: 7
- Joined: May 7, 2021
Why doesn't kbIsPlayerHuman() work for rm scripts?
I wrote a random map that needs to check if player is human. So I tried using kbPlayerIsHuman(). But it doesn't seem to work. Any alternatives?
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
Generally you can only call functions starting with rm during random map script generation. Functions starting with kb are for triggers and/or AI scripts.
I don't see an equivalent to kbIsPlayerHuman() in RM context https://mythicfreak.github.io/aomcodere ... layer.html
I don't see an equivalent to kbIsPlayerHuman() in RM context https://mythicfreak.github.io/aomcodere ... layer.html
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
Unfortunately there is no equivalent RMS-level function. Assuming you really do need it to be RMS-level (i.e. the map gets spawned depending on human players) then your best alternative is to create a function that checks the player names using rmGetPlayerName to see if they are that of an AI (i.e. the full list of Queen Isabella etc). Be warned though that this would only work if the host's game is in English. There is no way to use special characters in RMS, so it's not possible to extend this to other languages.
oranges.
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
There were some triggers you could use to pop a dialog on the screen, afaik, with a bunch of choices.
You could maybe pop one of those on the screen, asking the player to click an option.
But the problem with this is that it's likely to go OOS, if players click at different times.
An AI wouldn't answer.
But I don't know how this would work on DE, if your map is for that version, considering that they rewrote the networking part and it's no longer a peer-to-peer connection. Maybe on DE it wouldn't OOS.
You could maybe pop one of those on the screen, asking the player to click an option.
But the problem with this is that it's likely to go OOS, if players click at different times.
An AI wouldn't answer.
But I don't know how this would work on DE, if your map is for that version, considering that they rewrote the networking part and it's no longer a peer-to-peer connection. Maybe on DE it wouldn't OOS.
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
This won't help at RMS level. If it's after the map has started then he can just use the original kbPlayerIsHuman() at trigger level.Dolan wrote:There were some triggers you could use to pop a dialog on the screen, afaik, with a bunch of choices.
You could maybe pop one of those on the screen, asking the player to click an option.
But the problem with this is that it's likely to go OOS, if players click at different times.
An AI wouldn't answer.
But I don't know how this would work on DE, if your map is for that version, considering that they rewrote the networking part and it's no longer a peer-to-peer connection. Maybe on DE it wouldn't OOS.
oranges.
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
Another idea that could work would be: let the map include some kind of objective and let players know about it.
And if they go to an area on the map to collect a treasure you've let them know about, then this means they're not AI. They have self-directedness.
The drawback would be that this would take a while, so if you need to check if players are human immediately after the map is loaded, then maybe the name-checking method is what you're looking for.
And if they go to an area on the map to collect a treasure you've let them know about, then this means they're not AI. They have self-directedness.
The drawback would be that this would take a while, so if you need to check if players are human immediately after the map is loaded, then maybe the name-checking method is what you're looking for.
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
RMS level refers to the level at which the map dimensions are determined, hunt is spawned etc. This is the only stage at which rm-prefixed functions will work.
Trigger level refers to the level that starts "after" the map has spawned. "after" can include immediately, if you set the trigger to run immediately. rm functions will not work here, however it is possible to freely call on xs, kb, ui etc functions, and on DE, even ai functions.
Again, it goes back to what the OP's intention is. If it is to change map spawn and dimensions, then the name check is the only alternative. If it is nothing to do with map generation, then there is a lot more flexibility.
Trigger level refers to the level that starts "after" the map has spawned. "after" can include immediately, if you set the trigger to run immediately. rm functions will not work here, however it is possible to freely call on xs, kb, ui etc functions, and on DE, even ai functions.
Again, it goes back to what the OP's intention is. If it is to change map spawn and dimensions, then the name check is the only alternative. If it is nothing to do with map generation, then there is a lot more flexibility.
oranges.
- RevarloVlabius
- Crossbow
- Posts: 7
- Joined: May 7, 2021
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
Well, What I am trying to do is create triggers only if the player is human.
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
@RevarloVlabius
kb- functions are functions used inside the game. KB stands for Knowledge Base. So they are functions used to gather data about the current state of the game.
If you're trying to run them before the map is generated, there's nothing to apply them on.
Maybe you should clarify whether you're trying to check if a player is human before the map is loaded or after. And if after, does this need to happen immediately or can it also happen somewhat later after the map was loaded.
kb- functions are functions used inside the game. KB stands for Knowledge Base. So they are functions used to gather data about the current state of the game.
If you're trying to run them before the map is generated, there's nothing to apply them on.
Maybe you should clarify whether you're trying to check if a player is human before the map is loaded or after. And if after, does this need to happen immediately or can it also happen somewhat later after the map was loaded.
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
You could also create the triggers but simply not run them if the player is not human.RevarloVlabius wrote:Well, What I am trying to do is create triggers only if the player is human.
Which means you don't have to check if a player is human during map generation. You can just only run the triggers when a player inside the game does a human action or meets a condition that only applies to humans.
- RevarloVlabius
- Crossbow
- Posts: 7
- Joined: May 7, 2021
Re: Why doesn't kbIsPlayerHuman() work for rm scripts?
Nevermind, Imma apply this method (You could also create the triggers but simply not run them if the player is not human.).
Who is online
Users browsing this forum: No registered users and 9 guests