• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Fatal error =(

Status
Not open for further replies.
Level 2
Joined
Nov 10, 2008
Messages
14
Hi people, thanks for the interest!

So, I am making a map, and the camera is locked in the player's hero, but i wanted to the player can chenge his camera to a unit of his own, what would be cool for scout units and things like that.

So, i made the triggers:
  • Lock Camera
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to P1, offset by (0.00, 0.00) using Default rotation
      • Camera - Lock camera target for Player 2 (Blue) to P2, offset by (0.00, 0.00) using Default rotation
      • Camera - Lock camera target for Player 3 (Teal) to P3, offset by (0.00, 0.00) using Default rotation
This locks the camera to the player's unit.


  • Assasin
    • Events
      • Unit - A unit enters Assasin <gen>
    • Conditions
      • ((Unit-type of (Triggering unit)) Equal to Wisp) and (Pick_Taken[1] Equal to 0)
    • Actions
      • Set Pick_Taken[1] = 1
      • Unit - Hide Assasin 0027 <gen>
      • Unit - Create 1 Assasin for (Owner of (Triggering unit)) at (Center of Start <gen>) facing Default building facing degrees
      • If ((Owner of (Entering unit)) Equal to Player 1 (Red)) then do (Set P1 = (Last created unit)) else do (Do nothing)
      • If ((Owner of (Entering unit)) Equal to Player 1 (Red)) then do (Set P1SU = (Last created unit)) else do (Do nothing)
      • If ((Owner of (Entering unit)) Equal to Player 2 (Blue)) then do (Set P2 = (Last created unit)) else do (Do nothing)
      • If ((Owner of (Entering unit)) Equal to Player 2 (Blue)) then do (Set P2SU = (Last created unit)) else do (Do nothing)
      • If ((Owner of (Entering unit)) Equal to Player 3 (Teal)) then do (Set P3 = (Last created unit)) else do (Do nothing)
      • If ((Owner of (Entering unit)) Equal to Player 3 (Teal)) then do (Set P3SU = (Last created unit)) else do (Do nothing)
      • Unit - Remove (Triggering unit) from the game
      • Trigger - Camera lock <gen> (checking conditions)
This will set the variabels PX(Player X, that is a unit variable, which is used in the camera lock event) and PXSU(Player X starting unit, unit variable too, used this in the camera change trigger) to the hero that player selects.

  • Change Camera
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Camera Change
    • Actions
      • If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Set P1 = (Target unit of ability being cast)) else do (Do nothing)
      • If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Set P2 = (Target unit of ability being cast)) else do (Do nothing)
      • If ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) then do (Set P3 = (Target unit of ability being cast)) else do (Do nothing)
      • Unit - Remove Camera Change from (Triggering unit)
      • Unit - Add Camera Change to (Target unit of ability being cast)
This is the first camera change trigger, i don't think there are any relevant things to quote.

  • Change Camera P1
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to P1
          • (Triggering unit) Equal to P2
          • (Triggering unit) Equal to P3
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • If (P1 Equal to P1SU) then do (Trigger - Run Game Over P1 <gen> (checking conditions)) else do (Set P1 = P1SU)
This the second camera change event, I made one of this for every player(1, 2 and 3)


And after creating the ability and etc... e tested the map and got a error when i tried to use the spell:
209hw5d.jpg

note: actually the camera changes, but rigth after the change the error occurs.

I don't really know what is causing this error.

Thanks for the patience and attention:thumbs_up:
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Ok, a few things:

First trigger:
Make the Event 'Map Initialization' and change the unit to lock the camera on when it's created (in the second trigger)

Second trigger:
Use If/Then/Else triggers with multiple functions. Allways do that, becouse the 'Do Nothing' command is still an active command. This means that the computer will still execute the order Do Nothing (as if it were another command like 'move unit instantly' or something), which takes unnecessary memory use. By making If/Then/Else commands with nothing in the Else part, you get the same effect, but the computer has less to do.

Third trigger:
Same as above.

Fourth trigger:
Why do you check for P2 and P3 if it's only for Player 1 (Red)?
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
You probably got too much going on on your computer. Your computers RAM is full, so it can't xecute that many orders, so it gives a fatal error to free up RAM space. Simply shut down all other programs besides Warcraft III that you can miss (including the ones in the system tray in the lower right corner of the desktop) and then check again.
 
Level 6
Joined
Mar 15, 2005
Messages
112
start menu>run>msconfig to disable certain things from starting up if your using windows. If this is your problem that is. maybe try this
  • Change Camera
  • Events
  • Unit - A unit Begins casting an ability
  • Conditions
  • (Ability being cast) Equal to Camera Change
  • Actions
  • If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Set P1 = (Target unit of ability being cast)) else do (Do nothing)
  • If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Set P2 = (Target unit of ability being cast)) else do (Do nothing)
  • If ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) then do (Set P3 = (Target unit of ability being cast)) else do (Do nothing)
  • Wait .1
  • Unit - Remove Camera Change from (Triggering unit)
  • Unit - Add Camera Change to (Target unit of ability being cast)
 
Level 2
Joined
Nov 10, 2008
Messages
14
I can't belive, i just needed to put a wait >.<

Thanks Avator for the tips and IncubiProtocoL for the solution =)
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
That cant be right. The following action will never be ran, thus it is lost after waits.
  • Unit - Add Camera Change to (Target unit of ability being cast)
Which is actually explaining why the trigger works now.
When you in the first place made the trigger everything should have been fine... but!
You have the event - unit begins casting an ability.
'Target unit of ability being cast' does not register any unit for that event. It lead to the fact that you were trying to add an ability to a variable which had no reference yet (Target unit of ability being cast was undeclared in your case).
Conclusively you tried to add an ability to a unit which doesn't exist.

In the remade trigger you have a wait action, and Target unit of an ability being cast is not saved through a wait. This leads it to be set as null. You are trying to set an ability to a unit which is null. Null allows us to make mistakes in case we try to add something which does not match the specific 'input' (and it also changes a handle counter but lets not talk about that).

So generally the only thing which would have to be done was to remove the last action (and the wait).

If I am wrong, correct me, burn this post to ashes and spread it across the world. Have a nice day.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Yes, sure, the wait works. Wait works but do not save every data. In that case you were mildly lucky that it generated a spell target reference because, it registers after a 'Unit starts the effect of an ability' which is, usually around 0.2-0.5 seconds after the 'begins casting'. But generally, if you have another event firing at that moment, the spell target will be lost and possibly return a new error.
 
Level 6
Joined
Mar 15, 2005
Messages
112
Yea I was thinking target unit of ability being cast hadn't had a chance to be set. I think maybe target unit of ability being cast was set at the exact time the wait finished. Using starts the effect of an ability + no wait might be better, because target unit of ability being cast will be set before the trigger even triggers. Anyways always best not to use "Begins casting an ability". I'm surprised that wait worked actually. I just kinda threw it out there.
 
Status
Not open for further replies.
Top