Pan Camera Problem

M

MoolT

Guest
Ok so here's what I meant it to do.
A unit dies, it is acknowledged by the trigger.
[condition]
The player owning the unit must type -revive
[actions]
Send your screen over to the player.
Code:
Dying Group
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is in (Units of type Survivor)) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Entered chat string) Equal to -revive
            Then - Actions
                Camera - Pan camera for (Triggering player) to (Position of (Triggering unit)) over 1.00 seconds
            Else - Actions
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
You can't have an (Entered Chat String) if no chat string is entered. That trigger would execute instantaneously, so even if it could recognize an entered string after the event (it can't), it wouldn't have time to. You'll have to do something different.
 
M

MoolT

Guest
So I guess the only way to do it is setting the event to a chat message however they can type -revive when they're alive and I don't want it to pan camera so.. oh well I know how! make the event -revive and add a condition that unit must be dead. But then there won't be a triggering unit so.. hmm... if it's possible I should make a player group that contains only dead units and the action will be applied on picked players. What do you think?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Well, it depends on how many units you will be keeping track of. If you only have 1 unit per player, you could easily make a unit array variable and store all of the units in there.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Hehe, niceone;)
:D
Well, first put your hero in a variable... Then when it dies, you set a boolean Variable to True... Then you got another trigger that the event is "Player 1 red has entered the exact string "-revive"
Conditions:
Boolean- ..arg
ill just create it.. goes WAY WAY faster than writing;)
Code:
Untitled Trigger 001
    Events
        Unit - A unit Dies
    Conditions
        boolean[(Player number of (Owner of (Triggering unit)))] Equal to True
    Actions
        Set Hero[(Player number of (Owner of (Triggering unit)))] = (Dying unit)
        Set boolean[Player number of (Owner of (Triggering unit)))] = True

Code:
Untitled Trigger 001 Copy
    Events
        Player - Player 1 (Red) types a chat message containing -revive as An exact match
    Conditions
        boolean[(Player number of (Owner of (Triggering unit)))] Equal to True
    Actions
        Set boolean[(Player number of (Owner of (Triggering unit)))] = False
        Hero - Instantly revive Hero[(Player number of (Triggering player))] at (Center of (Playable map area)), Hide revival graphics
       Camera - Pan camera for (Triggering player) to (Position of Hero[(Player number of (Triggering player))]) over 0.00 seconds
Here...^^
Just that.. the "Set Hero[playernumber of triggering unit] = "Dying unit"" that should be moved, to where you create/get/choose the hero, just 0.00 seconds after...Or if the hero is preplaced, you set it at map initialization...You might wanna add a few conditions more.. that the hero dies = a hero = true... and it is not a computer hero..(or that doesnt matter..but, at least that it is a hero)!
Variables used:
Name Hero , Type Unit , Array Yes
Name boolean , Type Boolean , Array Yes
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Wouldn't it be easier to say:

Code:
Hero[(Player number of (Owner of (Triggering unit)))] is Dead Equal to True

as a condition after the chat?
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Yes, you could do that too of course.
Hundred ways of doing it...But I thought he should deal with the variables, both of them...learning more... And I created it like that because he needs to set the Hero[array]-variable, and now he could see where he could set it IRL... :)
 
M

MoolT

Guest
I'm assuming you've answered my question but sadly I don't understand what's going on.
Code:
 boolean[(Player number of (Owner of (Triggering unit)))] Equal to True
I can't understand what does it say..
I've never used arrays and don't know how to use them. Once I made a dialog and I assume that button[1] and button[2] are 2 different variables in one variable (which is the main use of arrays) but I don't see how is it useful here. I can see how it's useful but not how to use it in your code.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Once I made a dialog and I assume that button[1] and button[2] are 2 different variables in one variable (which is the main use of arrays) but I don't see how is it useful here. I can see how it's useful but not how to use it in your code.
Yes, button[1] = one button while button[2] = another button, in the same variable...
Same here with the heroes...If player 1 red dies.. the Hero[owner of dying unit] = Hero[1]...see? So, if you didnt have an array there and pl1 red and pl2 blue died at the "same time" (before the first player maanged to revive his hero)... Then the variable "HERO" would only contain one of those heroes, not both... Which one? The one that died last...So, therefore you need an array, UNLESS it is a single map?:D

I can't understand what does it say..
It is just saying, that one boolean array is either false or true... It has "nothing" to do with anything, it is just a variable that gives either true/false then you can use it in a yes.. in this exmaple
IF hero[1] = alive... you can set the boolean[1] = true.. if it dies you can set it to Boolean[1] = false..
THen you can use it whenever player1 red types -revive and check if boolean[1] = True OR false.. If it is false it means it is dead and you can revive it, if it is true, you do nothing...^^
 
M

MoolT

Guest
It is my 1st map which is an escape map (and I'm assuming again that you can see why). So yes, it's just one map, I'm gonna make 2 follow-ups but not in the same "campaign" cause I'm Way to anxious to wait until I finish 3 maps before releasing my 1st one and seeing what people think about it.
 
M

MoolT

Guest
BTW, I need beta testers and I was wondering if you wish to be one and give me some tips. Also I was wondering how do you write the info located at "quests" ((F9 button)).

I think I got what you explained me :)

ohh and MaaxeEvid...? ((wtf?))

p.s
I'm on northrend
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Also I was wondering how do you write the info located at "quests" ((F9 button)).
Here, in "Actions"...
Code:
Quest - Create a Required quest titled QUEST1 with the description INFO HErE!, using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp

I need beta testers and I was wondering if you wish to be one and give me some tips
Me? If so, thanks, but no thanks...

I think I got what you explained me
Good

Ps; I am on Northrend too.
 
M

MoolT

Guest
Yes it works! I've been fighting this script for an hour!
you wrote a condition at the 1st trigger which I haven't noticed but added it.
Code:
 boolean[(Player number of (Owner of (Triggering unit)))] Equal to True
which canceled my whole trigger and the 2nd one because my variable was set to false on default. Bottom line, it's fixed and now everything works just perfectly. So why did you add that line? (if it was on purpose) just to make sure I'll notice if it's set to false by mistake or something?
 
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