• 🏆 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!

Dat Alliance System 1.03

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: deepstrasz
Well I decided to try my hand at one of these and it seems I was quite successful. This should make it easier for anyone/everyone looking for such a system as this. No variables required at all. That's the bonus part, it's honestly better efficiency this way since you don't clog up your variable editor with un-needed names just for a system that doesn't get used often unless someone decides to spam it and even then there should be no lag. [Small Edit: I just tested it and proved that no matter how long and how fast you spam it, you can not lag the game up. You however can annoy yourself.]

Credits to Blizzard, fellow makers of similar systems as this for the encouragement and lastly you for using my system. Thank you, ask any questions you have here if needed.

I know this isn't unique, but I actually don't see one made like mine so in it's own way it is unique.


Figured that someone would complain otherwise, and well that just isn't right now is it? =)
[trigger=]
DAS
Events
Player - Player 1 (Red) types a chat message containing - as A substring
Player - Player 2 (Blue) types a chat message containing - as A substring
Player - Player 3 (Teal) types a chat message containing - as A substring
Player - Player 4 (Purple) types a chat message containing - as A substring
Player - Player 5 (Yellow) types a chat message containing - as A substring
Player - Player 6 (Orange) types a chat message containing - as A substring
Player - Player 7 (Green) types a chat message containing - as A substring
Player - Player 8 (Pink) types a chat message containing - as A substring
Player - Player 9 (Gray) types a chat message containing - as A substring
Player - Player 10 (Light Blue) types a chat message containing - as A substring
Player - Player 11 (Dark Green) types a chat message containing - as A substring
Player - Player 12 (Brown) types a chat message containing - as A substring
Conditions
Or - Any (Conditions) are true
Conditions
(Substring((Entered chat string), 1, 6)) Equal to -ally
(Substring((Entered chat string), 1, 8)) Equal to -unally
(Substring((Entered chat string), 1, 5)) Equal to -war
(Substring((Entered chat string), 1, 5)) Equal to -info
(Substring((Entered chat string), 1, 7)) Equal to -vision
(Substring((Entered chat string), 1, 9)) Equal to -unvision
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 10)) Equal to -unvision
((Triggering player) is giving (Player((Integer((Substring((Entered chat string), 11, 11)))))) Shared vision) Equal to True
Then - Actions
Player - For (Triggering player), turn Shared vision Off toward (Player((Integer((Substring((Entered chat string), 11, 11))))))
Game - Display to (Player group((Triggering player))) the text: (You have removed your vision with + (Name of (Player((Integer((Substring((Entered chat string), 11, 11))))))))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 8)) Equal to -vision
((Triggering player) is giving (Player((Integer((Substring((Entered chat string), 9, 9)))))) Shared vision) Equal to False
Then - Actions
Player - For (Triggering player), turn Shared vision On toward (Player((Integer((Substring((Entered chat string), 9, 9))))))
Game - Display to (Player group((Triggering player))) the text: (You have shared vision with + (Name of (Player((Integer((Substring((Entered chat string), 9, 9))))))))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 6)) Equal to -ally
((Triggering player) is an ally of (Player((Integer((Substring((Entered chat string), 7, 7))))))) Equal to False
Then - Actions
Player - Make (Triggering player) treat (Player((Integer((Substring((Entered chat string), 7, 7)))))) as an Ally
Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has decided to ally + (Name of (Player((Integer((Substring((Entered chat string), 7, 7)))))))))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 8)) Equal to -unally
((Triggering player) is an ally of (Player((Integer((Substring((Entered chat string), 9, 9))))))) Equal to True
(Triggering player) Not equal to (Player((Integer((Substring((Entered chat string), 9, 9))))))
Then - Actions
Player - Make (Triggering player) treat (Player((Integer((Substring((Entered chat string), 9, 9)))))) as an Neutral
Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has unallied + (Name of (Player((Integer((Substring((Entered chat string), 9, 9)))))))))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 5)) Equal to -war
((Triggering player) is an enemy of (Player((Integer((Substring((Entered chat string), 6, 6))))))) Equal to False
(Triggering player) Not equal to (Player((Integer((Substring((Entered chat string), 6, 6))))))
Then - Actions
Player - Make (Triggering player) treat (Player((Integer((Substring((Entered chat string), 6, 6)))))) as an Enemy
Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has declared war on + (Name of (Player((Integer((Substring((Entered chat string), 6, 6)))))))))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 5)) Equal to -info
Then - Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) slot status) Equal to Is playing
Then - Actions
Game - Display to (Player group((Triggering player))) the text: ((Name of (Picked player)) + ('s player number is + ((String((Player number of (Picked player)))) + , so just type -ally,-unally,-war that number to do said command.)))
Game - Display to (Player group((Triggering player))) the text: Extra commands are ...
Else - Actions
Else - Actions
[/trigger]


I'm pretty sure that nobody needs the JESP/Configurable data for this because if they actually need any help they just have to click a couple times. One trigger, zero variables. I consider that quite awesome really.

Keywords:
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,And now you know your alphabet!,!,Tal0n,Dat,C3,-,@,#,$,%,^,&,*,(,),1,2,3,4,5,6,7,8,9,0,epic,ca
Contents

DAS Version 3 (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 13:34, 4th Feb 2015 IcemanBo: Needs Fix upon request.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

13:34, 4th Feb 2015
IcemanBo: Needs Fix upon request.
 
Level 14
Joined
Dec 29, 2009
Messages
931
What's the benefit of using this over mine? http://www.hiveworkshop.com/forums/spells-569/alliance-handler-v1-3-a-261543/

Also the configuration is typically a requirement.
Users have to be able to configure your spell to their liking.

As for your system, the variables are added to make it more efficient, not less efficient.
This is basically the exact same thing as mine, except you made the player being allied, add an alliance to whoever is allying them.

You also missed a condition to check to ensure that you can't ally/unally yourself.
 
Last edited:
whats the point of the initial or block

skip remaining actions should not be needed in an else block

Forgot to remove those, was testing something. Will update soon.

maybe he copied your code
Does it seriously look copied?

What's the benefit of using this over mine? http://www.hiveworkshop.com/forums/spells-569/alliance-handler-v1-3-a-261543/

Also the configuration is typically a requirement.


As for your system, the variables are added to make it more efficient, not less efficient.
This is basically the exact same thing as mine, except you made the player being allied, add an alliance to whoever is allying them.

You also missed a condition to check to ensure that you can't ally/unally yourself.

The benefit is that yours requires three triggers and a lot of variables, yeah usually it is a requirement. The old days of GUI were sure funny though. Variables aren't required or even needed for such a system as this because it just makes the entire map slower with adding un-necessary extra data. Function calls are okay because this is a system that can't be slow anyways. I do not see how this is the exact same thing as yours.

Who would ally/unally themselves? I'll add that when I update I guess.
Edit: No matter what you can't ally yourself with that condition in place, however you can still unally/war yourself.
Looks pretty similar, doesn't it? But I mean if he can make it better than mine, more power to him. As it stands, there's no benefit to using this.
I was actually going to submit this last year, but I never got to it so as it stands it never even was inspired by yours or even made similar. There is a gigantic benefit though and that is that you can just copy and paste it and for once expect it to be perfectly working.

Good work on yours, but I haven't seen a system that has done this yet on here so I decided to submit one that does. I didn't see yours until recently.
 
Last edited:
You don't really need to economize with "extra variables" in my opinion. You can gain readability, performance, and it's easier to change 1 variable at a known position, instead of 5 constants spreaded in code.

There is nothing to gain from readability or even performance. It's a simple system, the only thing that people might change is the text that gets said when you ally/war/unally someone. Still, not worth it to sacrifice file size and variable size.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
EDIT: Don't worry, this isn't written in jass so it doesn't need to follow the JESP manifesto.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
sorry but I have to say that this is a flawed system, not in code base, but logically.

When I type -ally XX, then I automatically become ally with XX with shared vision, and he becomes my ally. This is extreme flaw in this system, because you could spoof players with this.

You should instead make it so that when I type -ally XX, the other player either has to type -ally My_name/color/whatever or -accept or something, and until they type this noone shares vision(so he cant see my units, and neither can I see his), and only after he accepted my ally request make our visions shared, or make it even configurable(not everyone wants to have shared vision in their map)
 
sorry but I have to say that this is a flawed system, not in code base, but logically.

When I type -ally XX, then I automatically become ally with XX with shared vision, and he becomes my ally. This is extreme flaw in this system, because you could spoof players with this.

You should instead make it so that when I type -ally XX, the other player either has to type -ally My_name/color/whatever or -accept or something, and until they type this noone shares vision(so he cant see my units, and neither can I see his), and only after he accepted my ally request make our visions shared, or make it even configurable(not everyone wants to have shared vision in their map)

Thanks, I have considered your opinion and edited my system.
 
Level 14
Joined
Dec 29, 2009
Messages
931
Now that you took that part out, your system is exactly like mine, it's harder to edit, it lacks features mine has, and it's slower.

The variables aren't there to hurt the system, it makes it faster.
Variables don't even take up that much space, and you can't easily edit anything with your system because of the lack of configuration options.
 
Now that you took that part out, your system is exactly like mine, it's harder to edit, it lacks features mine has, and it's slower.

The variables aren't there to hurt the system, it makes it faster.
Variables don't even take up that much space, and you can't easily edit anything with your system because of the lack of configuration options.

Not exactly, mine offers a tutorial. Harder to edit? Only one thing in every if block can be edited anyways. Yours is actually slower because you force it to loop. :grin:
It's easier typing -ally 1 then -ally red's name or -ally red.

Though I will likely just remake this because I am starting to really dislike all those function calls and some more features require at least one variable. A habit I grew into when I became really good at mapmaking. I don't know though, will have to test spamming with loops first I guess.
Edit: Maybe I can offer two versions, beginner and normal versions. =)
 
Last edited:

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
You forgot something:
  • (Player((Integer((Substring((Entered chat string), 11, 11))))))
->
  • (Player((Integer((Substring((Entered chat string), 11, 12))))))
Always add +1 at end else we cant ally players 10, 11 and 12. (2 digits).

@Faith: I totally agree with Dat-C3, this is not a loop so it won't be slow, and it won't be diferent with just more thousands of variables.
 
Level 14
Joined
Dec 29, 2009
Messages
931
Top