• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Neutral Side System.

Status
Not open for further replies.
Level 4
Joined
Apr 25, 2008
Messages
75
Hey all! This is yet another post for help on my Creature Island map. As you might know I am hopeless with the object editor so could someone please help me here.

I am making a faction (Bandits) that are controlled by some basic triggers. I have a base which has some shops in it if you complete a quest and therefore ally the bandits and a blockade that you encounter once you reach this new place. Now basically what I want is that the bandits do not attack you until you are enemies with them (you attack them). I have set it so they start neutral (Without shared vision) for the players but they just attack on sight. I made the acquisition range 0 too. I have based them off the bandit units.

What I have done:
Made a ransom system - You buy an item, the trigger activates and teleports you to other side of blockade. Works fine but you have to buy from a distance from the bandit commander (main guy at blockade) or else he attacks you. He doesn't move though because I set him to be a building (so that he keeps his post unless he is attacked and so that I could set a pathing map to make him impassable).

So what I want is:
Players start neutral, bandit commander to attack back when attacked as well as all the other bandits which I'm going to place (if commander attacks I assume the henchmen will too). But they only attack that player who attacked them. And if that player encounters a bandit patrol the patrol will attack on sight. Only way to become neutral again is to pay the bandit lord a tribute.
Shops only active when players allied (do quest and I set them allied through trigger).

So how can I achieve this? A quick summary of the alliance status
Neutral - Start as this do not attack on sight.
Enemy - Becomes this if they attack. Attack on sight.
Allied - Becomes this when completes a quest, can no longer attack bandits or vice versa. Access to shops.

{EDIT}
BUMP! Been up for 4.5 hrs and I've been up for 3.5 of those.... lol.
Can nobody help me?
 
Last edited by a moderator:
Level 5
Joined
Sep 13, 2008
Messages
165
Hmmm So
Once you Finish A quest, these Guys become allies with you.
They won't attack you ever, unless you attack them, they they get hostile. You can buy a item and you go to the other side. that works fine yea?

Ok, If you have any free player slots, This will be easy.
Make Player Brown The Bandits.
When Map Starts Make Brown Allied To Red Also Make Red Neutral towards Them.
When you finish the quest Make Red Allied with Shared Vision.
When you attack a bandit. Have a trigger that runs.
Events
A unit is attacked (Not the best way to do it, but it will still work)
Conditions
Owner of attacked unit is equal to Player 12 (Brown)
Owner of attacking unit is equal to Player 1 (Red)
Events
*Assuming you are ok with triggers and where to find things as well as setting variables*
Save player 1 and player 12's current diplomacy settings into varibles
Make Player 1 enemies without shared vision with, player 12 do that same with player 12
Set Timer [ReAlly] to X amount of seconds till they both become allies again.

When the timer Runs out (It will keep resetting as long as you attack the bandits) Really them
Events
Timer [ReAlly] Expires
Conditions
Events
Make Player 1 [The previous saved Ally status in the Variable] to player 12 do that same with player 12.

I don't have world editor open, so if you don't understand something, I will make up a test map for you.
 
Level 10
Joined
Jan 28, 2009
Messages
394
Ok - i dunno if this will work in your case but can you make all the bandits owned by Player Neutral.
Then you make a trigger...
Player 1 attacks unit / owner of unit is neutral / order unit to attack triggering unit.

Now if your player becomes ally with these bandits just add in a action to your trigger that turns off the "Player 1 attacks" trigger.
 
Level 10
Joined
Jan 28, 2009
Messages
394
Nah it would actualy means only the unit you attack will attack you back unless you make another trigger like with actions like - Move Region to location Attacking unit, Order all units in Region Owned by Player Neutral to Attack Attacking unit.

Yeah.. somthing like that >.>
 
Level 10
Joined
Jan 28, 2009
Messages
394
Zzz thats why you add the extra trig like i said. Anyways this might not be the direction he is going for. Its just alternative to the way you mentioned - that seems like would work fine except i dunno why you need variables in there.
 
Level 4
Joined
Apr 25, 2008
Messages
75
Ok guys, I took those ideas, butchered them, hacked at them with hand axes, and put it all back together and this is what I got:
(Note: Dark Green/Player 11 is the Bandits)
This is a Pokemon style map:
Active = Unit Variable (Array for each player) = The currently active creature(Pokemon)
CreatureTamer = Unit Variable (Array) The Main character
BanditStatus = Integer (Array) = 1 Means player is enemies with Bandits
2 means neutral
3 means allies

  • Pay Ransom
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Pay Ransom
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BanditStatus[(Player number of (Owner of (Buying unit)))] Greater than or equal to 2
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Buying unit) Equal to CreatureTamer[(Player number of (Owner of (Buying unit)))]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Bandit Blockade South <gen> contains CreatureTamer[(Player number of (Owner of (Buying unit)))]) Equal to True
                • Then - Actions
                  • Camera - Pan camera for (Owner of (Buying unit)) to (Center of Bandit Blockade Arrive North <gen>) over 2.00 seconds
                  • Unit - Move Active[(Player number of (Owner of (Buying unit)))] instantly to (Center of Bandit Blockade Arrive North <gen>)
                  • Unit - Move CreatureTamer[(Player number of (Owner of (Buying unit)))] instantly to (Center of Bandit Blockade Arrive North <gen>)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Bandit Blockade North <gen> contains CreatureTamer[(Player number of (Owner of (Buying unit)))]) Equal to True
                    • Then - Actions
                      • Camera - Pan camera for (Owner of (Buying unit)) to (Center of Bandit Blockade Arrive South <gen>) over 2.00 seconds
                      • Unit - Move Active[(Player number of (Owner of (Buying unit)))] instantly to (Center of Bandit Blockade Arrive South <gen>)
                      • Unit - Move CreatureTamer[(Player number of (Owner of (Buying unit)))] instantly to (Center of Bandit Blockade Arrive South <gen>)
                    • Else - Actions
                      • Game - Display to (All players matching ((Matching player) Equal to (Owner of (Buying unit)))) the text: |cffff0000ERROR:|r ...
            • Else - Actions
              • Player - Add 500 to (Owner of (Buying unit)) Current gold
              • Game - Display to (All players matching ((Matching player) Equal to (Owner of (Buying unit)))) the text: |cffff0000ERROR:|r ...
        • Else - Actions
          • Player - Add 500 to (Owner of (Buying unit)) Current gold
          • Game - Display to (All players matching ((Matching player) Equal to (Owner of (Buying unit)))) the text: |cffff0000ERROR:|r ...
  • Bandit Unally
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • BanditStatus[(Player number of (Owner of (Attacking unit)))] Equal to 2
          • ((Owner of (Attacking unit)) controller) Equal to User
          • (Owner of (Attacked unit)) Equal to Player 11 (Dark Green)
    • Actions
      • Set BanditStatus[(Player number of (Owner of (Attacking unit)))] = 1
      • Player - Make Player 11 (Dark Green) treat (Owner of (Attacking unit)) as an Enemy
      • Player - Make (Owner of (Attacking unit)) treat Player 11 (Dark Green) as an Enemy
      • Game - Display to (All players matching ((Owner of (Attacking unit)) Equal to (Matching player))) the text: |cffff0000You have ...
  • Pay Tribute
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Pay Tribute
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BanditStatus[(Player number of (Owner of (Buying unit)))] Equal to 1
        • Then - Actions
          • Set BanditStatus[(Player number of (Owner of (Buying unit)))] = 2
          • Game - Display to (All players matching ((Owner of (Buying unit)) Equal to (Matching player))) the text: You have payed the ...
        • Else - Actions
          • Player - Add 1800 to (Owner of (Buying unit)) Current gold
          • Game - Display to (All players matching ((Owner of (Buying unit)) Equal to (Matching player))) the text: |cffff0000ERROR: |r...
Ok I'm not finished yet, I still have to make the quest to become allies perfect and all but I know how I'm going to do it :)
 
Level 4
Joined
Apr 25, 2008
Messages
75
Bah, I'm hopeless with leaks. I know I gotta set something to a variable and use a Custom Script to destroy it but I don't really know what this thing is. Do you mean like the Regions? But if I destroy it, it won't work for the next player. Can you help me out here?
 
Level 5
Joined
Sep 13, 2008
Messages
165
Oh ok its easy, all you need to do is remember 1 thing, thats the custom script.
Create a Point Variable and call it Point or something easy to remember. Then Say you have
Unit - Move Active[(Player number of (Owner of (Buying unit)))] instantly to (Center of Bandit Blockade Arrive North <gen>).
Set 'Point' to (Center of Bandit Blockade Arrive North <gen>). Just before you call that code. Then Change the previous code to:
Unit - Move Active[(Player number of (Owner of (Buying unit)))] instantly to (Point).
Custom Script call RemovePoint(udg_Point) You can replace 'Point' with whatever you called your 'leak point' so it could be call RemovePoint(udg_IREXAMPLE) So to make a location leak free.

Set Point to (Center of Bandit Blockade Arrive North <gen>)
Unit - Move Active[(Player number of (Owner of (Buying unit)))] instantly to (Point)
Custom Script call RemovePoint(udg_Point)

However I'm not as efficient as a tutorial found on this site somewhere... Probably under tutorials.
 
Status
Not open for further replies.
Top