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

[Trigger] What causes FATAL ERROR

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2008
Messages
52
What causes FATAL ERROR and how do i prevent it.?

It's hppening every time i mae my civ_3 building either becuse of trigegr or because of unit editor. does my trigger look bad?

  • Civ 3
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add ((Number of living Civ Building 3 units owned by Player 1 (Red)) x 4) to Player 1 (Red) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 2 (Blue)) x 4) to Player 2 (Blue) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 3 (Teal)) x 4) to Player 3 (Teal) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 4 (Purple)) x 4) to Player 4 (Purple) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 5 (Yellow)) x 4) to Player 5 (Yellow) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 6 (Orange)) x 4) to Player 6 (Orange) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 7 (Green)) x 4) to Player 7 (Green) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 8 (Pink)) x 4) to Player 8 (Pink) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 9 (Gray)) x 4) to Player 9 (Gray) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 10 (Light Blue)) x 4) to Player 10 (Light Blue) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 11 (Dark Green)) x 4) to Player 11 (Dark Green) Current gold
      • Player - Add ((Number of living Civ Building 3 units owned by Player 12 (Brown)) x 4) to Player 12 (Brown) Current gold
But still answer 1st questions.

oh heres my variables too if it'll help me.

  • SET VARIABLE
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Civ_1 = (Units of type Civ Building 1)
      • Set Civ_2 = (Units of type Civ Building 2)
      • Set Civ_3 = (Units of type Civ Building 3)
      • Set Civ_4 = (Units of type Civ Building 4)
      • Set Civ_5 = (Units of type Civ Building 5)
      • Set Civ_6 = (Units of type Civ Building 6)
      • Set Civ_7 = (Units of type Civ Building 7)
      • Set Civ_8 = (Units of type Civ Building 8)
      • Set Civ_9 = (Units of type Civ Building 9)
      • Set Civ_10 = (Units of type Civ Building 10)
      • Set Civ_11 = (Units of type Civ Building 11)
      • Set Civ_12 = (Units of type Civ Building 12)
Also, how do I change my thread from unsolved to solved?
 
Level 2
Joined
Aug 26, 2008
Messages
26
I'm not really EXPERIENCED but I've had similar problems. It might be that you have too many actions for just one event, try a trigger for each player :nw:
 
Level 3
Joined
May 3, 2008
Messages
29
well its pretty evident u have too many actions at the same time. put a 2 seconds wait to each player.
and u can just the player group function u dont need to type it 12 times.
 
Level 3
Joined
Aug 18, 2008
Messages
52
as to vaziocs, what do you mean by 2 seconds wait? at first i used a 'unit group' then i switched to this trigger, then now i should switch back? or are you talking about JASS, because i only know SIMPLE basics of JASS. as in i know u start with function and end with end function. D=

could you show me an example of your trigger?
 
Level 2
Joined
Aug 26, 2008
Messages
26
as to vaziocs, what do you mean by 2 seconds wait? at first i used a 'unit group' then i switched to this trigger, then now i should switch back? or are you talking about JASS, because i only know SIMPLE basics of JASS. as in i know u start with function and end with end function. D=

could you show me an example of your trigger?
  • SET VARIABLE
  • Events
  • Map initialization
  • Conditions
  • Actions
  • Set Civ_1 = (Units of type Civ Building 1)
  • Wait 2 seconds
  • Set Civ_2 = (Units of type Civ Building 2)
  • Wait 2 seconds
  • Set Civ_3 = (Units of type Civ Building 3)
  • Wait 2 seconds
  • Set Civ_4 = (Units of type Civ Building 4)
  • Wait 2 seconds
  • Set Civ_5 = (Units of type Civ Building 5)
  • Wait 2 seconds
  • Set Civ_6 = (Units of type Civ Building 6)
  • Wait 2 seconds
and so on...

Or just do separate triggers. with one action each.
 
Level 3
Joined
May 3, 2008
Messages
29
as to vaziocs, what do you mean by 2 seconds wait? at first i used a 'unit group' then i switched to this trigger, then now i should switch back? or are you talking about JASS, because i only know SIMPLE basics of JASS. as in i know u start with function and end with end function. D=

could you show me an example of your trigger?

here use the player group function
and replace the players by picked player
Player - Add ((Number of living Civ Building 3 units owned by pickedplayer()) x 4) to pickedplayer Current gold
wait 2 seconds.
 
Level 3
Joined
Aug 18, 2008
Messages
52
so Curse... can i do like this? or whats maximum actions you suggest.
  • Civ 1 income
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add ((Number of living Civ Building 1 units owned by Player 1 (Red)) x 1) to Player 1 (Red) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 2 (Blue)) x 1) to Player 2 (Blue) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 3 (Teal)) x 1) to Player 3 (Teal) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 4 (Purple)) x 1) to Player 4 (Purple) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 5 (Yellow)) x 1) to Player 5 (Yellow) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 6 (Orange)) x 1) to Player 6 (Orange) Current gold
      • Wait 2.00 seconds
      • Player - Add ((Number of living Civ Building 1 units owned by Player 7 (Green)) x 1) to Player 7 (Green) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 8 (Pink)) x 1) to Player 8 (Pink) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 9 (Gray)) x 1) to Player 9 (Gray) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 10 (Light Blue)) x 1) to Player 10 (Light Blue) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 11 (Dark Green)) x 1) to Player 11 (Dark Green) Current gold
      • Player - Add ((Number of living Civ Building 1 units owned by Player 12 (Brown)) x 1) to Player 12 (Brown) Current gold
and im adding rep to both u guys, thx
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Well there IS such a thing as the op limit... but this should be no problem I think.

Goomba, it seems that you're not entirely understanding what a variable is and what it's used for...

A variable stores a piece of information. This information is never updated unless you update the variable yourself.
If you do:
  • Map Initialization
  • Actions
    • Set Civ_1 = units of type civ1
Civ_1 will only be the units of type civ1 that are preplaced on the map. If another building of type civ1 is constructed, the Civ_1 variable will NOT contain this building.

Secondly, you set Civ_1, but you NEVER actually use this variable. If you make a variable, it's pretty logical that you're going to use it too. Therefor, you must replace:

  • Player - Add ((Number of living Civ Building 3 units owned by Player 1 (Red)) x 4) to Player 1 (Red) Current gold
By

  • Set Civ_1 = Units owned by Player 1 of type civ1 <-- By putting this action IN the incometrigger, you update Civ_1 by the CURRENT units of type civ1.
  • Player - Add ((Number of units in Civ_1)) x 4) to Player 1 (Red) Current gold
  • Set Civ_1 = Units owned by Player 2 of type civ1 <-- By putting this action IN the incometrigger, you update Civ_2 by the CURRENT units of type civ1, this time owned by player TWO.
  • Player - Add ((Number of units in Civ_1)) x 4) to Player 2 (Blue) Current gold
Without initializing Civ_1 with "Units owned by Player 1 of type civ1", civ_1 will not contain any units. By only initializing it at map initialization, Civ_1 will only contain the units that were PRE-placed on the map, and not the units that were constructed later.

I would normally talk about fixing memory leaks now, but it looks like you're still in the process of learning the basics, so it's better you get skilled at GUI before moving on to that part...

I don't want to overwhelm you with "new" GUI actions, but you could also make your trigger much shorter by inserting a loop.

A For loop will iterate its actions inside the body a certain amount of times. For instance:
  • For each Integer A from 1 to 12 do
    • Loop - actions
      • Set Civ_1 = Units owned by Player (Integer A) of type civ1
      • Player - Add ((Number of units in Civ_1)) x 4) to Player (Integer A) Current gold
Integer A will start at 1 and do every action inside "Loop - actions" 12 times.
As you can see, you can use the current value of Integer A in your loop. So you can refer to Player (Integer A). Every iteration of the loop will thus refer to another player.
If Integer A currently is 1, you will add gold to Player 1
Next, Integer A becomes 2, you will add gold to Player 2
...
Finally, Integer A will become 12, you will add gold to player 12.
 
Level 3
Joined
Aug 18, 2008
Messages
52
alright ive never used integers but Eleandor, you just probably saved me so much time. or at least you woulda if i had explored integers a week ago... =( And yea, I'm new. I just got hosting a week ago and I've been learning GUI and TRYING to learn JASS through like 2 huge tut's on this, but i just don't get it..... I just don't understand when you should say 'call' and how you know what to type in as in 'call udg_temp_unit_group'. I dont know what to put after call and everything you have to type in yourself bt thats for another another day lol. I'm just gonna get a lil more basics on triggers and then go to JASS. Gl to me. I'd add rep but I cant cause i got 0 rep points (i need 10)

Whats the difference from integer A and integer B?
 
Level 3
Joined
Aug 18, 2008
Messages
52
quick thing rtho, will using that looping trigger make it so that it only gives cash if its alive? and yea, I made those var's for aother trigger which i switched to this income trigger and now to another!!!! what a waste of time!!!

Lol, and im a qucik learner, i've only been doing this for about a week and a half and i got some good basics down.

Oh and i got 1 more problem if u don't mind. (it's from another post but no 1 answered it forever) My income buildings stack right on top of eacher and I don't want that. At the most, I'd liek them to stack halfway over eachother, but definitely not right on top of eachother.

> I unchecked the 'requires buildable' and 'is prevented by unbuildable' because I have some tiled terrain that's (unbuildable) that i'd lilke for things to be built on.

> I also put both 'can be built on' and 'can build on' to false>>> so what's up?
 
Status
Not open for further replies.
Top