Jump to content
  • 0

NPC Conditions


Ainz Ooal Gown

Question

@jcsnider I was wondering about NPC Behaviour conditions.

 

If "Player Firned/Protector" is met by a player variable (so only that player has that variable applied to them, say a random number) does this mean the NPC wont attack the player with the variable or any players at all when condition is met? Also same question for other conditions "Should no attack player on sight" and "Player can attack"?

 

Thanks Bud

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0
37 minutes ago, jcsnider said:

It only applies to the single player who has the correct variable value. 

 

Thanks for the reply JC, but doesnt seem to working that way for me, unless Im doing something wrong. When an aggressive NPC has condition in Player Friend/Protector: Player Variable EQUALS Player Variable, it seems to apply for all players.

 

Example:

 

Player 1 has Player Var = 1

Player 2 has Player Var = 2

 

NPC has Player Friend/Protector condition as Player Var 1 = Player Var 1, it should not attack player 1 and attack player 2 right?

 

Like this:

Spoiler

66298787dc1d2b82cc56795053717108.png

 

 

Link to comment
Share on other sites

  • 0
4 minutes ago, jcsnider said:

The condition runs for each player individually. As pictured you're looking to see if a players variable is equal to itself which will always be true for all players. 

 

Ah crap! I didnt think of that... hmmm so would need it set as a global variable! EDIT: Nah that wont work either when I think about it, as each time someone uses the global var it will change... hmmm

 

Thanks for the help and guidance buddy  :P

Link to comment
Share on other sites

  • 0
2 minutes ago, AisenArvalis said:

You need to check it against static value instead of the variable.
If Drone Deploy = 1 instead of If Drone Deploy = Drone Deploy

I can probably help you with this over Discord as well if you want

 

I was doing it that way so that it would give a random number to a players var so it would not collide with another players variable so multiple summons can happen across the game with no conflict. I think the solution would be to combine both player and global variables. I will have a look tonight when I get in from work. Sure I will hit you up on Discord

Link to comment
Share on other sites

  • 0

@Ainz Ooal Gown I found the answer you wanted. I'll give you the tutorial and then you test it and please answer me if it worked. If it works you can add it to your npc summoning tutorial. Works for PVP and PVE.

 

1 - Choose 2 player variables. Let's simulate two player variables '' spawn '' and '' summon ''.

 

2 - Choose the npc. And put it aggressive only. And NPC vs NPC enabled [monsters that he must kill must also have NPC vs NPC enabled with him on the list]. In my game I simulated Slime [with npc vs npc enabled and Guard in the list] and the Guard [who will be summoned, with npc vs npc enabled with slime in the list].

 

3 - In the friend / protector condition of the player, guard, set this.
Spawn = Summon

 

4 - Create 2 common events.
An event that is activated in login
And when logging in, set these commands
Set player variable, spawn, random 1 to 1000000
Set player variable, summon, random 1 to 1000000

 

Simple common event without trigger
Spawn Guard on player
Set Spawn = Summon

 

So far, the npc will attack players as well as other npcs. I tested I can confirm.

 

As an option, you can define at the end of this event,
wait 10000ms.
despawn npc
Set player variable, spawn, random 1 to 1000000
Set player variable, summon, random 1 to 1000000

 

What remained to test was two players activating the spell at the same time. and guard with npc vs npc enable with guard in the list.

If you can test it for me and give me feedback, I would also like to thank you.

 

That way, the invoked npc attacked another player and also monsters.

Link to comment
Share on other sites

  • 0
2 hours ago, Weylon Santana said:

@Ainz Ooal Gown I found the answer you wanted. I'll give you the tutorial and then you test it and please answer me if it worked. If it works you can add it to your npc summoning tutorial. Works for PVP and PVE.

 

1 - Choose 2 player variables. Let's simulate two player variables '' spawn '' and '' summon ''.

 

2 - Choose the npc. And put it aggressive only. And NPC vs NPC enabled [monsters that he must kill must also have NPC vs NPC enabled with him on the list]. In my game I simulated Slime [with npc vs npc enabled and Guard in the list] and the Guard [who will be summoned, with npc vs npc enabled with slime in the list].

 

3 - In the friend / protector condition of the player, guard, set this.
Spawn = Summon

 

4 - Create 2 common events.
An event that is activated in login
And when logging in, set these commands
Set player variable, spawn, random 1 to 1000000
Set player variable, summon, random 1 to 1000000

 

Simple common event without trigger
Spawn Guard on player
Set Spawn = Summon

 

So far, the npc will attack players as well as other npcs. I tested I can confirm.

 

As an option, you can define at the end of this event,
wait 10000ms.
despawn npc
Set player variable, spawn, random 1 to 1000000
Set player variable, summon, random 1 to 1000000

 

What remained to test was two players activating the spell at the same time. and guard with npc vs npc enable with guard in the list.

If you can test it for me and give me feedback, I would also like to thank you.

 

That way, the invoked npc attacked another player and also monsters.

 

Thanks for that buddy, but I already tried it like this but unfortunatley its not sound proof, as if the player 1 casts the summon them NPCs dont attack him, but if player 2 casts the spell the NPCs wont attack him. Atleast until the spell event hits the wait time and randoms the number again :(, close but no cup of tea.

 

Still looking for a sound proof way using events but not sure is fully possible for PvP.

Link to comment
Share on other sites

  • 0
3 hours ago, Ainz Ooal Gown said:

 

Thanks for that buddy, but I already tried it like this but unfortunatley its not sound proof, as if the player 1 casts the summon them NPCs dont attack him, but if player 2 casts the spell the NPCs wont attack him. Atleast until the spell event hits the wait time and randoms the number again :(, close but no cup of tea.

 

Still looking for a sound proof way using events but not sure is fully possible for PvP.

 

Totally for pvp I do not guarantee.  Why if two players summon at the same time the monsters will not attack.  (unless they are programmed to attack each other).  Using a necromancer-class system they could not use "helpers" to attack other necromancers.  In your game as there are no classes, a helper will not attack if another player calls at the same time.  I would say that in pvp it would be 70% functional.  We have to think about the following question: what is it that each player has, that is unique, that can be used as a condition in the "friendly / protector"?  If we have an answer then we will have the behavior we want from npc.

Link to comment
Share on other sites

  • 0
15 hours ago, Weylon Santana said:

 

Totally for pvp I do not guarantee.  Why if two players summon at the same time the monsters will not attack.  (unless they are programmed to attack each other).  Using a necromancer-class system they could not use "helpers" to attack other necromancers.  In your game as there are no classes, a helper will not attack if another player calls at the same time.  I would say that in pvp it would be 70% functional.  We have to think about the following question: what is it that each player has, that is unique, that can be used as a condition in the "friendly / protector"?  If we have an answer then we will have the behavior we want from npc.

 

After further investigation I dont think it is possible with only 1 NPC to have PvP. You could however create a few summons that are unique and only one player could have it for a set time are something like that. But that would be extra work. I think this is best for just PvE for the moment until source is released.

Link to comment
Share on other sites

  • 0
21 hours ago, Ainz Ooal Gown said:

 

After further investigation I dont think it is possible with only 1 NPC to have PvP. You could however create a few summons that are unique and only one player could have it for a set time are something like that. But that would be extra work. I think this is best for just PvE for the moment until source is released.

I Got It

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...