HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

help with lumber adding trigger!

11-28-2006, 12:55 AM#1
SlickR
hi there, i'm having problems making/editing triggers for lumber adding.
What i want to do is every (example 5 seconds of game time if a player has Xtreme lumber mill to add 2 (or more) lumber for that player every 5 seconds and basicly every Xtreme lumber mill to give 2 lumber every 5 seconds!

i have working trigers which some guy helped me with also which are something like this:
Event:
time-Every 5 seconds of game time
condition:
for each (integer A)from 1 to 11 do (actions)
action:
set gold_count=number of living Xtreme lumber mill units owned by (player((integer A)))
player-add gold_count to (player(integer A)) current lumber

gold_count is variable (integer) with value 0(default)

i've tries with same variable with value 2 but it just doesent work as i want it, for example sometimes it gives only 1 lumber, other times it doesent give any lumber and so on...

any idea?
EDIT: Oh and those trigers work but i can only add 1 lumber in a time interval and yes i'm using them for my current lumber mills!
11-28-2006, 02:57 PM#2
The)TideHunter(
You just need to times the amount of the buildings by 2, so simple..

Trigger:
Blah
Collapse Events
Time - Every 5.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 11, do (Actions)
Collapse Loop - Actions
Player - Add ((Number of living Xtreme lumber mill units owned by (Player((Integer A)))) x 2) to (Player((Integer A))) Current gold
11-28-2006, 08:08 PM#3
SlickR
it doesent work, and for that mather the trigers you wrote make wc3 crash after 5 seconds!
i gues it mauby something to do with the variable (gold_count) i'm using!?
11-28-2006, 08:31 PM#4
The_AwaKening
The trigger that TideHunter posted should work just fine. You must have trouble with the variable or the way you made the trigger in your map.

If you know how to implement JASS into a trigger, I could give you a JASS trigger so that you wouldn't have to do anything.
11-28-2006, 08:33 PM#5
TaintedReality
No. I bet you put the x2 inside the Player(Integer A), check that part again. At least that's my guess, because Tide's trigger works perfectly fine.

Quote:
If you know how to implement JASS into a trigger, I could give you a JASS trigger so that you wouldn't have to do anything.

And then how is he going to learn anything? He'll just come back later with new questions about the same concepts. Too many times these days I see people just posting JASS code for people who don't even understand JASS. That's not going to help them.

Edit: Sorry that sounds harsh, I know you're just trying to help him.
11-28-2006, 08:40 PM#6
The_AwaKening
Quote:
And then how is he going to learn anything? He'll just come back later with new questions about the same concepts. Too many times these days I see people just posting JASS code for people who don't even understand JASS. That's not going to help them.

On the contrary, he could learn something from it. I learned most of my JASS by reading code made by other people or converting GUI to JASS. Of course, there is the possibility he would just look at it and learn nothing from it because he chooses not to. That's why I asked before taking the time to make it for him.

I'm just sitting here bored at work and need something to do =)
12-04-2006, 03:47 AM#7
SlickR
Quote:
Originally Posted by TaintedReality
No. I bet you put the x2 inside the Player(Integer A), check that part again. At least that's my guess, because Tide's trigger works perfectly fine.



And then how is he going to learn anything? He'll just come back later with new questions about the same concepts. Too many times these days I see people just posting JASS code for people who don't even understand JASS. That's not going to help them.

Edit: Sorry that sounds harsh, I know you're just trying to help him.
sorry for the late reply but i have been very busy with my studies these days so i didn't have the time to edit my map.
yea i put X2 in the integer a, i've used arithmetic value1=INTEGER A value2=X2.
you know another way of doing it without arithmetic?
anyways ideas? i still have the problem!
12-05-2006, 03:11 PM#8
The)TideHunter(
If you are still having the problem, your trigger isent identical to mine.
The one i posted works.
12-05-2006, 10:23 PM#9
SlickR
Quote:
Originally Posted by The)TideHunter(
If you are still having the problem, your trigger isent identical to mine.
The one i posted works.
and how is your trigger, did you put the X2 into Integer A using arithmetics or what???
-If so, then it must be my variables i'm using for the current lumber and gold mills that are causing the crashing!
12-05-2006, 10:36 PM#10
wyrmlord
Quote:
Originally Posted by SlickR
and how is your trigger, did you put the X2 into Integer A using arithmetics or what???
-If so, then it must be my variables i'm using for the current lumber and gold mills that are causing the crashing!
You shouldn't need any variables for this trigger, just do the trigger Tide Hunter typed out. As for each exact action... you use arithmetic. The first value would be the number of units in the unit group (living lumber mills owned by Player(Integer A)). And then you can put whatever you want for the arithmetic operation and the other number.
12-06-2006, 12:01 AM#11
Relyte
I've got pretty much the exact same trigger.
Here's my code, converted for your uses.
Trigger:
Collapse Events:
Time - every 5 seconds of game time
Conditions:
Collapse Actions:
Collapse Player Group - Pick every player in (All Players) and do (Actions)
Collapse Loop - Actions
Player - Add (Number of living Mills owned by Picked Player) to (picked player) current (lumber)
12-07-2006, 08:59 AM#12
SlickR
OK, thanks to all who replyed and helped me out, it turns out the mistake was in the position of the X2.
thanks again!