I am trying to create a trigger or something to do what I want and that is to create a group or something called Province. I want the following units: Village, Town, City to be in the Province Group so when I apply something to the Province it will apply to all units that are inside . I am having trouble figuring out how to do it. The problem is Town and City doesn't appear in the Value when I try to Add unit to group, because they are not on the map.
Events :
Unit - Any Unit Enters (Entire map) ?
Local Variables :
???
Conditions :
???
Actions:
what unit ? there is no value for my town or city to add it .
If your town/city are already preplaced on the map then run a loop picking each unit, use conditions to specify only town/city units, and add the unit to unit group. If the town/city are not preplaced but rather added into the map via other triggers, just use the add unit to unit group action after creating the unit by using "last created unit" in the unit term. You should absolutely NOT being using any additional triggers to do this; especially with a unit enters event as willuwontu suggests which is extremely bad. Even in the most complex of systems or if you only do this some of the times after creating a unit via triggers you should just use a custom threaded definition with conditions.
Well... I gave up this solution .. at least for now.. I found it hard for the triggers to count units from this and other triggers were giving me more headaches with this than without. So I just added more triggers/lines and did it the easier way and seems to work good.
I also have a problem with some calculation, I am sure I am missing something.
It is about the income and income dialog (that is showing in the game for the player)
The income is calculated right , so no problem there, but the variable for the dialog is not calculating it right...
What I am trying to do is to make it show in game the divided energy of the province by 20 +(( number of villages +towns+cities) divided by 2 )
As you said the issue is in the dialogs and you've only posted just one part of the coding that doesn't even include dialog work. Im betting you're likely not using convert real/integer to text.
What else do you need to know ?
If you wonder about the village, town, city and province group, they are all working fine because the income is generated fine. The problem is in this Dialog thing, it is not showing it fine.
Ok, I managed to make it work but not perfect. Now the problem is it doesn't divide by 2 from the end of the formula.
I will attach a photo . http://postimage.org/image/mmoitdi1j/full/
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey,
I am trying to create a trigger or something to do what I want and that is to create a group or something called Province. I want the following units: Village, Town, City to be in the Province Group so when I apply something to the Province it will apply to all units that are inside . I am having trouble figuring out how to do it. The problem is Town and City doesn't appear in the Value when I try to Add unit to group, because they are not on the map.
Any ideas how to do that or is it any other way ?
event: unit enters entire map
condition: or:
unit type of unit == town
unit type of unit == city
actions: add unit to unit group (province)
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
I dont understand, can you be more specific ?
Events :
Unit - Any Unit Enters (Entire map) ?
Local Variables :
???
Conditions :
???
Actions:
what unit ? there is no value for my town or city to add it .
condition:
use an or condition
then set two more conditions which check the unit type of the triggering unit against the ones you want
actions:
the triggering unit.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
If your town/city are already preplaced on the map then run a loop picking each unit, use conditions to specify only town/city units, and add the unit to unit group. If the town/city are not preplaced but rather added into the map via other triggers, just use the add unit to unit group action after creating the unit by using "last created unit" in the unit term. You should absolutely NOT being using any additional triggers to do this; especially with a unit enters event as willuwontu suggests which is extremely bad. Even in the most complex of systems or if you only do this some of the times after creating a unit via triggers you should just use a custom threaded definition with conditions.
@hobbidude: Go
Well... I gave up this solution .. at least for now.. I found it hard for the triggers to count units from this and other triggers were giving me more headaches with this than without. So I just added more triggers/lines and did it the easier way and seems to work good.
I also have a problem with some calculation, I am sure I am missing something.
It is about the income and income dialog (that is showing in the game for the player)
The income is calculated right , so no problem there, but the variable for the dialog is not calculating it right...
What I am trying to do is to make it show in game the divided energy of the province by 20 +(( number of villages +towns+cities) divided by 2 )
http://postimage.org/image/djxaef1lz/full/
Anyone ?
As you said the issue is in the dialogs and you've only posted just one part of the coding that doesn't even include dialog work. Im betting you're likely not using convert real/integer to text.
Here is an overview image. http://postimage.org/image/oj0rijsjr/full/
What else do you need to know ?
If you wonder about the village, town, city and province group, they are all working fine because the income is generated fine. The problem is in this Dialog thing, it is not showing it fine.
I guess no one knows ?
Ok, I managed to make it work but not perfect. Now the problem is it doesn't divide by 2 from the end of the formula.
I will attach a photo . http://postimage.org/image/mmoitdi1j/full/