Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 844 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Follow the enemy! #140840
07/13/07 00:37
07/13/07 00:37
Joined: Apr 2006
Posts: 58
Moerk Offline OP
Junior Member
Moerk  Offline OP
Junior Member

Joined: Apr 2006
Posts: 58
Hi there,
ive got a question and i dont know for what i should search so i will post my problem now.

I´ve got a Tower. It´s a lasergun who is static implented in a station. If a entity comes nearer the lasergun should rotate to the enemy if he´s friendly the lasergun only follows, if he is unfriendly it should begin to fire...

AT the moment i´m scanning that with these command lines:

Code:

action geschuetzturm
{
while(1)
{
if(vec_dist(my.x, menu_patroule.x) < 200) //is that a good solution?
{
// What here?
}
wait(1);
}
}



I hope you can help me!

greetings!

ADD:

I´m using bones to animate the lasergun. I want to rotate the main on the tower and all of its children!

Last edited by Moerk; 07/13/07 00:40.

"Die Kette die mich ewig hält möge man erst noch schmieden" Regina S.
Re: Follow the enemy! [Re: Moerk] #140841
07/13/07 04:52
07/13/07 04:52
Joined: Apr 2007
Posts: 582
Germany
Poison Offline
User
Poison  Offline
User

Joined: Apr 2007
Posts: 582
Germany
Also ich glaube schon.
jetzt musst du halt in diesen bereich alles scripten was der geschützturm überhaupt machen soll.

ob er den spieler attackieren soll oder etwas ganz ganz anderes machen soll.
Lies dir dazu einfach die AUMs 55,56,57 durch.


Everything is possible, just Do it!
Re: Follow the enemy! [Re: Poison] #140842
07/15/07 07:55
07/15/07 07:55
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
can't help you with the follow-only-bad-guy part, cause I don't know what your bad guy is, but I have some code for a tower rotating towards a player:

Code:


action geschuetzturm
{
while(1)
{
if(vec_dist(my.x, menu_patroule.x) < 200) //is that a good solution?
{
vec_diff(temp,menu_patroule.x,my.x);
vec_to_angle(temp,temp);
my.pan += ang(temp.pan - my.pan)*0.1*time_step;
}
wait(1);
}
}




try that...
Micha


~"I never let school interfere with my education"~
-Mark Twain

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1