Following
» Siedler Map Source Forum » Siedler DEdK Script Forum » Following
Seiten: 1
Qba331PL
|
#1 19.07.2018 13:40 Beiträge: 102 |
Following
Hi!
How looks function that makes entity follow another entity. I know that I can use SimpleJob and Move function but it looks strange and it doesn't work as good as normal follow.
SH
|
#2 19.07.2018 15:03 Beiträge: 127 |
In SimpleJob instead of
Move( "entity1","entity2" )
you can do
if IsAlive( "entity2" ) then
Move( "entity1","entity2" )
end
____________________
Sorry for my German
Dieser Beitrag wurde von SH am 19.07.2018 um 15:11 editiert.
Riesenadler
|
#3 19.07.2018 16:34 Beiträge: 19 |
If entity1 is a Troop you can use
Logic.GroupGuard(GetID("entity1"), GetID("entity2"))
If not, I'm not sure.
Another method is
CreateNPC{ name = "entity1", follow = "entity2" }
but I haven't tested one of them.
____________________
"Wer im Glashaus sitzt, sollte sich im Dunkeln ausziehen."
- Ein schlauer Mensch
SH
|
#4 19.07.2018 16:43 Beiträge: 127 |
Zitat von Riesenadler:
If entity1 is a Troop you can use
Logic.GroupGuard(GetID("entity1"), GetID("entity2"))
If not, I'm not sure.
Another method is
CreateNPC{ name = "entity1", follow = "entity2" }
but I haven't tested one of them.
Do you know haw to do a patrolling group?
____________________
Sorry for my German
Qba331PL
|
#5 19.07.2018 16:44 Beiträge: 102 |
Zitat von SH:
In SimpleJob instead of
Move( "entity1","entity2" )
you can do
if IsAlive( "entity2" ) then
Move( "entity1","entity2" )
end
Yes, but I was thinking about something dffrent, not about Move(ent1,ent2). Something that will remove that strange moves(when entity that follows, stays in one place, it makes strange moves).
Or when one entity follows second entity, and then they meet some enemyes, entity that follows, fights in stupid way (it attack and then it tryies to move to second entity again)
Qba331PL
|
#6 19.07.2018 16:46 Beiträge: 102 |
Oh, you wrote that post when I was writing mine post. I will check this method. Thanks!
Riesenadler
|
#7 21.07.2018 00:05 Beiträge: 19 |
Zitat von SH:
Do you know haw to do a patrolling group?
Logic.GroupPatrol(_id, _positionX, _positionY) --sends a group onto Patrol between current Position and given Position Logic.GroupAddPatrolPoint(_id, _positionX, _positionY) --sets another Patrol Point for a Group
____________________
"Wer im Glashaus sitzt, sollte sich im Dunkeln ausziehen."
- Ein schlauer Mensch
Seiten: 1