- Joined
- Jun 14, 2007
- Messages
- 56
Hellooo!
Now this one is quite a simple one. but i'm having difficulty with eeet
I will post code shortly, atm i cant access my worldedit will fix soon.
The basics:
- Trying to programme a unit that checks houses in a map room by room
- The code is vjass in a library
- I use the struct room which has integers area/house/part and rect (corresponding location) and boolean checked. global room array is used to create the rooms and refer to them elsewhere
- i have a seperate trigger with actions that run the function EnterRoom that orders the unit to the next room in the library
- i have another trigger that loops and adds the events to the above trigger UnitEntersRect(ROOM[x].rect) x loops up to the max number of rooms obviously
- the function EnterRoom only takes unit. the way i tried to get the triggering rect that he entered was the if RectContainsUnit function (combined with is rect the target rect etc) But the thing is sometimes it doesnt quite work because the unit doesnt seem to be in the rect immediately after entering. waiting 1 second after entering seems to work but obviously this is a messy idea.
If possible think of this problem as explaining how to move the spawning units from start to finish in a maze tower defense using vjass because its the same idea!
Now this one is quite a simple one. but i'm having difficulty with eeet
I will post code shortly, atm i cant access my worldedit will fix soon.
The basics:
- Trying to programme a unit that checks houses in a map room by room
- The code is vjass in a library
- I use the struct room which has integers area/house/part and rect (corresponding location) and boolean checked. global room array is used to create the rooms and refer to them elsewhere
- i have a seperate trigger with actions that run the function EnterRoom that orders the unit to the next room in the library
- i have another trigger that loops and adds the events to the above trigger UnitEntersRect(ROOM[x].rect) x loops up to the max number of rooms obviously
- the function EnterRoom only takes unit. the way i tried to get the triggering rect that he entered was the if RectContainsUnit function (combined with is rect the target rect etc) But the thing is sometimes it doesnt quite work because the unit doesnt seem to be in the rect immediately after entering. waiting 1 second after entering seems to work but obviously this is a messy idea.
If possible think of this problem as explaining how to move the spawning units from start to finish in a maze tower defense using vjass because its the same idea!