- Joined
- Jul 19, 2009
- Messages
- 8
I am making a game, and have some problems with the trigger editor since its UI is kinda confusing. What I am basically trying to do is create a unit that's a "sniper". I already programmed his attack and skills except now I am planning to give him a "sniper scope".
This skill basically is a toggleable skill that when turned on will give him over 1000 vision only in the direction where he is facing. His normal vision radius is 500. So his vision will look like this with the skill on:
S: the sniper
O: where he can see
X: fog of war
Basically what I wanted to do was have the skill summon 10 invisible wards in front of the sniper thereby giving him vision in the area.
In pseudocode this is how I programmed it:
For some reason this does not work. Could anyone tell me why?
Second question:
After these wards are created, is there a way to automatically add them all to a unit group so I may force them to do actions later on?
If this is not the optimal way to program this, is there a better way? The world editor interface is boggling my head.
Oh yeah, also what do you guys think is the best skill to base this skill off?
d
This skill basically is a toggleable skill that when turned on will give him over 1000 vision only in the direction where he is facing. His normal vision radius is 500. So his vision will look like this with the skill on:
S: the sniper
O: where he can see
X: fog of war
Code:
XXXOOXXXXXXXXXXXXXXXXXXXX
XXOOOOOXXXXXXXXXXXXXXXXXX
XOOOSOOOOOOOOOOOOOOOOXXXX
XXOOOOOXXXXXXXXXXXXXXXXXX
XXXOOXXXXXXXXXXXXXXXXXXXX
Basically what I wanted to do was have the skill summon 10 invisible wards in front of the sniper thereby giving him vision in the area.
In pseudocode this is how I programmed it:
Code:
if(skill pressed == sniper scope skill)
{
for(int counter = 1; counter is <= 10; counter++)
{
Create a unit (ward) at position of triggering unit with polar offset
(500*integerToReal(counter), directionThatUnitIsFacing) facing
directionThatUnitIsFacing
}
}
Second question:
After these wards are created, is there a way to automatically add them all to a unit group so I may force them to do actions later on?
If this is not the optimal way to program this, is there a better way? The world editor interface is boggling my head.
Oh yeah, also what do you guys think is the best skill to base this skill off?
d
Last edited: