Resurrection Help

K

kingsqeerel

Guest
I'm making an RPG and I want to have Ressurection Stones with a Circle of Power in front of them. I want it so whenever a player types "-bind" without quotes, while standing on the Circle of Power, the game will remember which stone they bound at (there will be multiple) and a hero will spawn there when killed with a small loss of EXP. Is there any one who could help me with this? I know it sounds a little demanding, but it would help a lot. Thanks.
 
C

Chele

Guest
As there would be multiple players(that's what I guess) you will need an array of either locations or integer numbers (you could give each stone a particular number). Then you would store each player's current stone in his element of the array.
 
K

kingsqeerel

Guest
Uhhh.... what? Sorry, but I'm not really good at trigger editor, but I know all the basics and stuff. But I really had no idea what you said. Sorry.
 
C

Chele

Guest
For a start, does your map have many players ? (more than one I mean)
 
C

Chele

Guest
Ok. Then, to store the current stone of each player you need either 6 variables or one 6-variable array. Making it with an array would save loads of time and unnecessary tirggers but it's a wee bit harder... Shall I explain how arrays work or are you familiar with'em ?
 
K

kingsqeerel

Guest
I really don't know much about variables, please explain.
 
C

Chele

Guest
This will take some time, but I'll consider it worthwile... A variable is a space on the computer's memory that takes a certain value and can be modified dinamically. In World Editor in particular variables can store every type of data (particular units, unit-types, integer numbers, leaderboards, etc.). They are used basically to store information you need to use in other parts of your trigger or even other triggers. For example, if you are making a trigger that will do many actions to the owner of a particular unit, instead of referencing that player through Owner of(Triggering Unit) every single time you can create a Player variable called Guy and use
Set Guy = Owner of(Triggering Unit)
Form then onwards "Guy" stores that player (it can be re-set to someone else so you may use the same variable in many triggers). The uses of variables are almost endless if used correctly.
Now, as for arrays, these are just that, arrays of a certain number of variables of the same type. Unlike single variables, these are accesed using:
"Name"["Index"] Where "Name" is of course the array name and "Index" is an integer number that represents a particular element of that array. To create an array just tick "Array" when creating a variable and specifiy its size (number of elements).
For your problem in particular I was suggesting making a 6-element array and store the resurrection spot of each of the six players in different elements. Did that help :eek: ? Anyway, feel free to ask.
 
K

kingsqeerel

Guest
Yes, that does help, but how would I make a couple triggers that when you type -bind and so on, with the EXP less and everything? And for each player?
 
C

Chele

Guest
I really can't think of an easy way to do it. From the two ideas I have one requires you to create 6*number of stones triggers and the other one to create 6 triggers and a region array with <number of stones> elements. Choose one :p .
 

Sim

Forum Administrator
Staff member
Reaction score
534
Ok I will do this but lemme time

It might take long !! :p I will edit soon.
 
K

kingsqeerel

Guest
I looked at some different triggers, but none of them seem like they would work for me. Can someone who really knows what they are doing help by describing how to make something like this?
 

Sooda

Diversity enchants
Reaction score
318
Uff... you have to use variables to do it for all players and it is not so hard at all. I can' t give you trigger code because my CD-ROM is broken right now, I will just type you core how to do it.
First of all, in events use player types chat string what is exact mach as "-bind" (without " " ofcourse). You don' t need to add any conditions though I think for now. Then in actions first "If/ Then/ Else" comparison units in region (example first resurection region) matching unit belongs to triggering player equal 1 then set variable (example: resurection region) = region 000 <= First region. If unit dies resurect/ creat that unit with nessesary trigger to region and chooce region variable "resurection region".
Resurection variable is region-variable. Make it array and chooce from index convert player index to player and use triggering player.
 
B

Beelzebubson

Guest
event - player 1 red types -bind as an exact match
player 2.....
conditon -

actions - if then else
if - unit is in region x
then - set RevivePoint[ player number of trigering player] region x
else -
if then else
if - unit is in region y
then - set RevivePoint [ player number of trigering player] region y
else -


something like that
sorry i dont have world editor infront of me
 

Sim

Forum Administrator
Staff member
Reaction score
534
Ok I got it. It all works but I didn't test the part when you aren't in the bind region. Only when you are in. Here are the triggers. I will list the variables below.

Code:
Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set Bind_Area[1] = Bind1 <gen>
        Set Bind_Area[2] = Bind2 <gen>
        Set Bind_Area[3] = Bind3 <gen>
        Set Bind_Area[4] = Bind4 <gen>
        Set Bind_Area[5] = Bind5 <gen>
        Set Bind_Area[6] = Bind6 <gen>

Code:
Enter Bind
    Events
        Unit - A unit enters Bind1 <gen>
        Unit - A unit enters Bind2 <gen>
        Unit - A unit enters Bind3 <gen>
        Unit - A unit enters Bind4 <gen>
        Unit - A unit enters Bind5 <gen>
        Unit - A unit enters Bind6 <gen>
    Conditions
    Actions
        Set Bind_Time[(Player number of (Owner of (Triggering unit)))] = True

Code:
Exit Bind
    Events
        Unit - A unit leaves Bind1 <gen>
        Unit - A unit leaves Bind2 <gen>
        Unit - A unit leaves Bind3 <gen>
        Unit - A unit leaves Bind4 <gen>
        Unit - A unit leaves Bind5 <gen>
        Unit - A unit leaves Bind6 <gen>
    Conditions
    Actions
        Set Bind_Time[(Player number of (Owner of (Triggering unit)))] = False

Code:
Binding
    Events
        Player - Player 1 (Red) types a chat message containing -bind as An exact match
        Player - Player 2 (Blue) types a chat message containing -bind as An exact match
        Player - Player 3 (Teal) types a chat message containing -bind as An exact match
        Player - Player 4 (Purple) types a chat message containing -bind as An exact match
        Player - Player 5 (Yellow) types a chat message containing -bind as An exact match
        Player - Player 6 (Orange) types a chat message containing -bind as An exact match
    Conditions
        Bind_Time[(Player number of (Triggering player))] Equal to True
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Set Player_Units[(Integer A)] = (Units in Bind_Area[(Integer A)] owned by (Triggering player))
                Set Number_Units = (Number of units in Player_Units[(Integer A)])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Number_Units Greater than or equal to 1
                    Then - Actions
                        Set Bind_Owned[(Player number of (Triggering player))] = True
                        Set BindStone_Number[(Player number of (Triggering player))] = (Integer A)
                        Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: (You are now bound to the Bindstone  + (String(BindStone_Number[(Player number of (Triggering player))])))
                    Else - Actions
                        Do nothing

Code:
Dying and Revive
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Bind_Owned[(Player number of (Owner of (Dying unit)))] Equal to True
            Then - Actions
                Hero - Instantly revive (Dying unit) at (Center of Bind_Area[BindStone_Number[(Player number of (Owner of (Dying unit)))]]), Show revival graphics
                Hero - Set (Dying unit) experience to ((Hero experience of (Dying unit)) - (100 x (Hero level of (Dying unit)))), Hide level-up graphics
            Else - Actions
                Game - Display to (Player group((Owner of (Dying unit)))) for 10.00 seconds the text: As you are not boun...

Here are the variables :

- Bind_Area as a Region variable with Array (6)
- Bind_Owned as a Boolean variable with Array (6)
- Bind_Time as a Boolean variable with Array (1)
- BindStone_Number as an Integer variable with Array (6)
- Number_Units as an Integer variable
- Player_Units as a Unit Group variable with Array (6)

If someone here finds a mistake in there please tell me.

I didn't remove leaks, I didn't have enough time.

Good Luck, and I hope it won't bug. Add more things as this trigger is incomplete. It must fit your map. This is just what you need for the complicated things. I hope you know where to add text. Reply here if you really have problems.

EDIT: I think Number_Units should be Array with [(Player number of (Triggering Player))]...

Add it. Change Number_Units to Array with size (1) and set the Index to (Player number of (Triggering Player)).

But since the trigger has no waits in, unless 2 players write "-bind" exactly at the same time it should work. But for safety, add in an array. :p
 
K

kingsqeerel

Guest
Beelzebubson, when you say, "then-set RevivePoint..." how do I do that? Sorry I need so much help.
 
K

kingsqeerel

Guest
It's just REALLY intimidating. All your triggers make me really confused. :eek:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top