• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Enemy with shared vision

Status
Not open for further replies.
Level 13
Joined
Sep 14, 2008
Messages
1,407
My Problem:

I am making a map with 8 players where they are on an island and have a limited vision.

Now I made a spell which creates a fire at a position which heals units around it.

The problem now is:

1.

I want the fire (it's a unit) to belong to Player 9 (which is computer controlled)
and that player 9 have shared vision with all other players. BUT they are supposed to be enemies.

So I go like this:

Playergroup - set alliance -> Make Player (playergroup containing all playing players) treat Playergroup(Player 9) as enemy with shared vision.


Ok what happens:

The fire will be enemy of the other players but the vision will not be shared.

_______________________________________________

2.

Second problem is a single trigger line:

Open the map -> go trigger "experience" and take a look at the disabled line.
Whenever I enable it the point "lastPos" will constantly stay in the middle of the playable map area.

Any suggestions?



I added the map as attachment so you can take a look.

Thanks for help in advance
 

Attachments

  • Island of Dreams.w3x
    2.6 MB · Views: 50
Level 13
Joined
Feb 18, 2009
Messages
1,381
For the first you could possibly create a dummy unit which has a limited range??
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
For problem 1: did you try adding the buff "Faerie Fire" on the enemy?
Pick all enemy units, create caster dummy, cast faerie fire.
If an enemy unit is spawned and [boolean] = true, then cast faerie fire on the enemy.
Once [boolean] turns false, remove faerie fire from all units.

Problem 2: shouldn't you destroy the leak after you set the location? ( and shouldn't you switch LastPos with MomPos, as LastPos is based on MomPos, though MomPass is called after LastPos).
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
1.
Is faerie fire really the only solution?
Shouldn't the "shared vision" alliance thing work too :/?

2.
I can't clear the leaks after because I need them later.
Because momPos is going to be the later lastPos.

So i thought I do it like this:

MomPos = X
LastPos = Y

Then:
lastPos is cleared and afterwards set to MomPos -> LastPos = X
(so there should be nothing what could leak)
MomPos is cleared and afterwards set to the new Positoin of the Hero -> MomPos = Z
(so again there is nothing what could leak)

but now when I clear MomPos after setting LastPos to MomPos, LastPos becomes "center of playable map area"
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
If you use the Alliance thingie, other people will also be able to see the fires, other then their own!
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
YES Thanks etzer XD you got my point.
That's exactly what I want it to be.

Maybe the ability describiton helps you:

"Creates a simple fire which..[..]. But the bright light of the fire will be seen from anywhere of the map. So only use this if you are at a safe place".

I WANT it to have shared vision with EVERYONE of the 8 players. (even though they are all enemies.)
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
Oh lol. Well, if you don't have a fire, you wont be able to see the other fires, so FF or a dummy is the only solution
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
Ok I try to expain it again:

Player 1 - 8 are normal human players.
Player 9 is a computer.

So when the fire is created the ownership of the fire changes to Player 9.
And NOW i want the other 8 HUMAN players to treat player 9 as an enemy with shared vision (which should be possible as it is a gui action)
That would make the 8 guys see the fire because they share their vision with player 9.

But it doesn't work. The fire becomes an ENEMY but NOT with shared vision.

Maybe this make the whole thing clear.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
For problem #1:
  • Unit - Grant shared vision of MyFire to ThisPlayer
That would be the basic action you could use without setting any alliances.

Edit: I guess you could also do
  • Player - ThisPlayer treat Player 9 (Gray) as an Enemy with shared vision
If you want to do this for all players, you could use a loop or do it with a player group.

Edit 2:
For problem #2:
I'm not entirely sure about this, but I think you're supposed to remove that line.
When you remove MomPos, you're might be actually removing the location that LastPos would be referring to.
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
@watermelon

2. that was exactly what I was thinking too :/ because without the line it works fine.
But it would leak then wouldn't it :/

And it would be a leak every 0.5 sec for every player resulting in 16 leaks per second...
I doubt that that is good :D

1. Oh i never knew the unit give vision thing :D
Thanks

The second trigger is the one which is not working for me. You have the same trigger for playergroups and that simply does not give the shared vision.
I try the first one :D
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
Once again, this is just speculation, but I think you don't need to worry about leaking since you remove that location before you set it, right?

eeeeh well no :/ The line which SHOULD remove it before it is set sadly also removes the "lastPos" which is set TO "momPos" in the line before. And as it will ruin the whole system I can't use that line.

So momPos i just set to "position of hero" without being cleared.
 
Status
Not open for further replies.
Top