Page 1 of 3

Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:12 pm
by Darktiger138
I made some quest variables to initialize unit production, but they wont work.

I enable the variable here:

t_tri Nob Spawn
t_jm t_eve Events
t_lin t_jb t_tim Time - Elapsed game time is 10.00 seconds
t_j t_co Conditions
t_jbm t_act Actions
t_emp t_j t_lea Quest-Disable Level1Units
t_emp t_jb t_lea Quest-Enable Level2Units


Then use it here:

t_tri SpawningDG2
t_jm t_eve Events
t_emp t_jb t_tim Time-Every 5.00 seconds of game time
t_jm t_co Conditions
t_lin t_jb t_if (Level2Units is enabled) equal to True
t_jbm t_act Actions
t_emp t_jb t_ugr Unit Group-Order(Units owned by Player 11(Dark Green) of type Ork Houz to train a Nob

but it doesnt work, the unit doesnt get produced.

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:13 pm
by 3ICE
There is no event on the second trigger, so it never fires.
A periodic time event would suffice.

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:23 pm
by Darktiger138
Oops, I missed the event

t_eve Events
t_emp t_jb t_tim Time-Every 5.00 seconds of game time

thats what I have for the second one

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:25 pm
by 3ICE
In that case, check to make sure the player has enough resources to train the unit. Also make sure the unit can be trained (no tech requirements, listed on the building, training time close to 0, gold/wood/supply cost 0)

Debugging step: Change everything (units, triggers, resources) around, so you are the dark green player. Does anything happen?

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:27 pm
by Darktiger138
I have the cost of the unit at 0 gold 0 lumber 0 food, so thats not the problem.

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:27 pm
by 3ICE
At this point sharing the map would be the quickest way to a solution.

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:30 pm
by Darktiger138
Its no where near finished and its a bit of a mess, but sure.

I attached it to my first post.

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:39 pm
by 3ICE
As mentioned above:
3ICE wrote:...make sure the unit can be trained (..., listed on the building,...)

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:40 pm
by Darktiger138
I thought that was the problem, but the Shoota Boi units dont get trained either, under the same circumstances.

Re: Making new units be built by a Comp controlled barracks.

Posted: Fri Apr 13, 2012 7:53 pm
by 3ICE
The SpawningDG1 trigger never fires. If I delete the condition, it works.

It is because you are using quests instead of boolean variables for storing a true/false value.
Quests need to be initialized before they can be enabled:
This is how to do it This is how to do it
t_lea Quest - Create a Required quest titled t with the description d, using icon path i t_set Set Level1Units = (Last created quest) t_lea Quest - Enable Level1Units