System Reputation system

Weirdoze

New Member
Reaction score
6
INFO:
So, I've created an easy reputation system that can be used in all kinds of maps, using it is up to you. It includes a very basic ranking system (no rank names or anything) so feel free to expand the system in any way. (but if you use it as a template for something, please, do give me credits :thup:)

What does it require:
It is so simple without the rank system it requires laughable 4 triggers and 3 variables! (2 integer, 1 unit-type [1 integer and 1 unit-type with array]).

Where can I use it:
You can use it anywhere! By the system killing enemy units adds reputation and there are not too many wc3 mods where you don't kill enemies. Mostly it's made for an ORPG I'm working on, but you can use it in TDs, Tags.. or what ever you like.

Expanding the system:
I only made a very basic template of it, so you are free to expand the system in all directions (as mentioned before). Here I provide you with some ideas:

*You can make -rep from killing your own units just by changing all the + to -

*You can create rank names those are displayed when ever you want to see your reputation

*You can create different prices from acquiring a high reputation (I have prices in my map, but there is only experience) example: items, skills, control of some specific unit, alliance with a nation or.. anything

And here i present the system:

First, I'll be setting reputation values or units:

Code:
Settings
    Events
        Map initialization
    Conditions
    Actions
        Set Player_Reputation = 0
        Set Reputation_Values[1] = 10
        Set Reputation_Units[1] = Peon
        Set Reputation_Values[2] = 50
        Set Reputation_Units[2] = Troll Headhunter
        Set Reputation_Values[3] = 75
        Set Reputation_Units[3] = Grunt
        Set Reputation_Values[4] = 100
        Set Reputation_Units[4] = Troll Witch Doctor
        Set Reputation_Values[5] = 250
        Set Reputation_Units[5] = Shaman
        Set Reputation_Values[6] = 300
        Set Reputation_Units[6] = Spirit Walker
        Set Reputation_Values[7] = 500
        Set Reputation_Units[7] = Raider
        Set Reputation_Values[8] = 625
        Set Reputation_Units[8] = Kodo Beast
        Set Reputation_Values[9] = 750
        Set Reputation_Units[9] = Tauren
        Set Reputation_Values[10] = 1000
        Set Reputation_Units[10] = Blademaster
2 variables:
So, Reputation_Values is an integer with array 10 and it is used to detect the reputation amount gained from every unit. The other one Reputation_Units is an Unit-Type variable with array also 10 (array equals to the amount of units you want to set a reputation_value)

To the second trigger where I add the reputation to player
Code:
Adding reputation
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Killing unit)) Equal to Player 1 (Red)
    Actions
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[1]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[1])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[2]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[2])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[3]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[3])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[4]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[4])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[5]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[5])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[6]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[6])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[7]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[7])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[8]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[8])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[9]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[9])) else do (Do nothing)
        If ((Unit-type of (Dying unit)) Equal to Reputation_Units[10]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[10])) else do (Do nothing)
In the event a unit dies, and if the killer is equal to player red we add reputation to player red. This way it takes more time but I think it's easier. (The other way you set every unit a custom value [in object-editor] and add Player_Reputation the Custom value of unit) So, in the last trigger we set up unit types and reputation value, now all we have to do is add the reputation value to to players reputation. It's like, if a dying unit is a peon we add the reputation_amount of the peon (which is set to 20) to players reputation amount (integer without array, satrting value 0)

and down the third:

Code:
Showing reputation
    Events
        Player - Player 1 (Red) types a chat message containing -sr as An exact match
    Conditions
    Actions
        Game - Display to (All players) for 10.00 seconds the text: (Your reputation: + (String(Player_Reputation)))

Now, when player red types in the message -sr (or what ever u want[sr = show reputation)] he will see the amount of reputation he has gained. And thats all with the triggers.

There are some "ranking" things in the map, but I don't see the need of adding those triggers here. (if you want to see them, just download the map)

Overall:
-The system is very flexible
-It can be modified easily
-You can use it in all maps
-It is noob friendly

Last words:
Just tell me if there is something wrong with this tutorial [map is tested and triggers should be leakless]. And if there are many who like this system, I will make a bigger and better tutorial [including things I mentioned in "Expanding the system"]. I guess that's all, if you like the tutorial give me +rep. I really tried to do something useful :eek:
*Comments are highly appreciated*
 

Attachments

  • Reputation system.w3x
    32 KB · Views: 288

Weirdoze

New Member
Reaction score
6
Okay, now I added triggers to the tutorial, and hope it is clearer now.

A few comments wouldn't be bad.. I mean is this tutorial as useless as sunglasses at night? Or did it maybe help somebody? Comment dear people, comment. :(
 

XxShadyxX

I abused the rep system.
Reaction score
81
You should add rank names, and another good idea you should add is that when you get up to a certain reputation you get a "award buff" Which helps you.
Another Idea is, if you have ever played fable before, you should have it if your rep goes really low you start to get a "evil Buff". The evil buff will probably make shops charge you more or Neutral passive units run away from you when you go near them.

Idk just my 2 cents :thup:

Keep up the good work!
 

Weirdoze

New Member
Reaction score
6
heh, thanks for the first positive comment, but i was thinking just to leave this one as a template for the lack of comments (no comments = no one likes it/it's nothing special) :D
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Hey its still to new just give it a week then if no comment then noone probaly likes it
 

XxShadyxX

I abused the rep system.
Reaction score
81
Even if no one likes it build up on it. Make more features. Anything and if you make it good enough then it will be approved.
 

Weirdoze

New Member
Reaction score
6
Well, maybe you guys are right, but I think I'm too busy learning C++ now. So I'm abandoning WE (for now atleast) :p
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
This is what you have...
Trigger:
  • Adding reputation
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Killing unit)) Equal to Player 1 (Red)
    • Actions
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[1]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[1])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[2]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[2])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[3]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[3])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[4]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[4])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[5]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[5])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[6]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[6])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[7]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[7])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[8]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[8])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[9]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[9])) else do (Do nothing)
      • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[10]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[10])) else do (Do nothing)

Woah... Ever heard of loops? This is what it should be, much shorter but accomplishes the exact same task.
Trigger:
  • Adding reputation
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Killing unit)) Equal to Player 1 (Red)
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[(Integer A)]) then do (Set Player_Reputation = (Player_Reputation + Reputation_Values[(Integer A)])) else do (Do nothing)


EDIT: And why does this only work for one player? Why not turn Player_Reputation into an array, indexed by the player number?

Trigger:
  • Adding reputation
    • Events
      • Unit - A unit Dies
    • Conditions
      • --- Don't know if you still want conditions once it's MPI ---
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If ((Unit-type of (Dying unit)) Equal to Reputation_Units[(Integer A)]) then do (Set Player_Reputation[(Player number of (Owner of (Killing unit)))] = (Player_Reputation[(Player number of (Owner of (Killing unit)))] + Reputation_Values[(Integer A)])) else do (Do nothing)


Or are things like this the kind of changes we are supposed to make ourselves, based on the template?
 

Weirdoze

New Member
Reaction score
6
ehh guys.. are you even thinking what you are saying? This is NOOB friendly unlike Loops or "hash based on the unit type id"...

You didn't get my point... so please, dont give negative comments.
 

Septimus

New Member
Reaction score
58
ehh guys.. are you even thinking what you are saying? This is NOOB friendly unlike Loops or "hash based on the unit type id"...

You didn't get my point... so please, dont give negative comments.

Loop are also noob friendly and way more effective.. lol..
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Loops is more noob friendly than hav to do things many times without loops
 

XxShadyxX

I abused the rep system.
Reaction score
81
Hey wierdoze just wanted to let you know that im going to make a reputation system of my own and I will post it here on the TH, just wanted to let you know, and i will give credit to you for the "idea"
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
ehh guys.. are you even thinking what you are saying? This is NOOB friendly unlike Loops or "hash based on the unit type id"...
So noob friendly equals horribly coded?
 

Jesus4Lyf

Good Idea™
Reaction score
397
This is NOOB friendly unlike Loops or "hash based on the unit type id"...
You could hash based on the unit type ID for O(1) complexity without any interface change. It would just mean it is actually efficient. :)

So, it would be just as friendly. "Noob friendly" isn't a phrase to throw out there when you don't feel like improving your code. You're submitting a system.
 

Devyn90

New Member
Reaction score
0
Okay, I know the post is old, and I'm a noob, but I just have to ask.

Let's say I have 2 Factions, Player 2 and 3. If I kill a unit that belongs to Player 2, my reputation with Player 3 will increase, while my reputation with Player 2 will decrease, and vice versa, what would that/those trigger/s look like? I've been trying for a while now, and would like some help with it ^^

Thanks in advance
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top