Removing inventory control for allied computer player?

Level 15
Joined
Jul 12, 2018
Messages
560
I assume this is really simple but the search function yields absolutely nothing.

I'm doing an RPG. Two factions exist. Players will be allied with one or the other, the factions are represented by one computer player each.

I want this faction-representing computer player that all either good or evil players ally up to, to have (pre-placed) heroes which are allied with the player as far as fighting together if they are both attacked at the same time. So far so good.


But the player should not be able to steal, use or give orders related to this computer player's inventory items, which for some reason are totally available to the player no matter what aspects i set of the alliance. I want this player's inventories to be grayed out for the user players. This is the part i need help with.

Thanks in advance.
 
By default, if you untick "Share Unit Control"--then it'll behave as you described and you won't be able to use your ally's items. Not sure if that is an option for your map though.
ForceProperties.png
 

Attachments

  • TestAllyItems.w3m
    16.9 KB · Views: 2
Level 15
Joined
Jul 12, 2018
Messages
560
By default, if you untick "Share Unit Control"--then it'll behave as you described and you won't be able to use your ally's items. Not sure if that is an option for your map though.
View attachment 481724
Cheers. They are on separate forces to begin with as the map doesn't know which side the player will pick at init, and i have triggers creating the alliances. I've tried the trigger that says change aspect of alliance and disable share unit control after making them allies though, which ought to produce the same result but curiously does nothing for me.
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
I think you can trigger some basic anti-steal system like this
  • Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Owner of (Triggering unit)) Equal to YourAlliedPlayer
    • Actions
      • Item - Make (Item being manipulated) Undroppable
It's a bit extreme but that way their inventory would be locked. Can't really figure out a similar way to prevent the use of consumables though :<
 
Level 15
Joined
Jul 12, 2018
Messages
560
I think you can trigger some basic anti-steal system like this
  • Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Owner of (Triggering unit)) Equal to YourAlliedPlayer
    • Actions
      • Item - Make (Item being manipulated) Undroppable
It's a bit extreme but that way their inventory would be locked. Can't really figure out a similar way to prevent the use of consumables though :<
That's a really good idea, i think i'll run with that. this is a one time spawn at start of map so that's not a big hassle to do and doesn't need to be flexible for a lot of purposes, i just wanna have hard to get items equipped on hard to kill heroes for you to see and mire while you're too low lev to kill them. Thus consumables are easy, i'll just avoid them. Suppose i'll have to avoid active use items too. Appreciate the suggestion.
 
Cheers. They are on separate forces to begin with as the map doesn't know which side the player will pick at init, and i have triggers creating the alliances. I've tried the trigger that says change aspect of alliance and disable share unit control after making them allies though, which ought to produce the same result but curiously does nothing for me.
I was able to get a similar effect with this:
  • Alliances
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
Would that work? (it uses Player - Set Alliance instead of Player - Set Aspect of Alliance)
 
Level 21
Joined
Mar 16, 2008
Messages
955
I think the best way to do this is to give the AI heroes 6 items with 1000 priority. That way the AI "thinks" it has the best items in the game. The Priority field in object editor lets you control "how important" the items are to AIs.

The triggers won't work and the AI will override them.
 
Level 15
Joined
Jul 12, 2018
Messages
560
I was able to get a similar effect with this:
  • Alliances
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
Would that work? (it uses Player - Set Alliance instead of Player - Set Aspect of Alliance)

That is how it is originally set up. Then i started messing with Set Aspect of Alliance to try to maket the items unavailable, to no effect.



I think the best way to do this is to give the AI heroes 6 items with 1000 priority. That way the AI "thinks" it has the best items in the game. The Priority field in object editor lets you control "how important" the items are to AIs.

The triggers won't work and the AI will override them.

The AI isn't doing anything that i wouldn't want, i just don't want user players to be able to mess with or steal the AI player's items.
 
Last edited:
Level 21
Joined
Mar 16, 2008
Messages
955
You want the AI heroes to hold items and have shared control with players - but you don't want players to be able to manipulate the AI's hero items? Maybe try adding additional Cpu Players only to control the AI heroes. These Cpus will be simple allies and not allies with shared control.

Another idea would be swap the hero in question to the 2nd Cpu (non-shared control) any time a player clicks on that hero. This might cause issues in combat or other problems though.
 
Level 15
Joined
Jul 12, 2018
Messages
560
You want the AI heroes to hold items and have shared control with players - but you don't want players to be able to manipulate the AI's hero items? Maybe try adding additional Cpu Players only to control the AI heroes. These Cpus will be simple allies and not allies with shared control.

Another idea would be swap the hero in question to the 2nd Cpu (non-shared control) any time a player clicks on that hero. This might cause issues in combat or other problems though.
Thank you for your response. reading it made me go through my triggers and run some tests. I never tried to share control for this player and i'm not using that command anywhere. I realized i am coming up against a limitation of another system i am using.
For the quest giving and lore / talking with NPCs i am having items sold masking as abilities. i forget the reason i originally did this over abils but i'm sure it was good. Turns out the shared inventory comes from me adding the shop abilities to make them talkable. Now that i know this i will work around it or try removing those abils when it's time to fight. Appreciate the help.

I don't know how to mark the thread as solved or if that's even available to me, but thread resolved.
 
Last edited:
Top