Server Help

ASSS Questions - Creating Fake Turrets

Initrd.gz - Sun Feb 15, 2009 1:22 pm
Post subject: Creating Fake Turrets
I am trying to create a module like hs's pointdefence, but a bit more configurable (eg. Firing repels, bursts). I am looking at hs's pointdefence module, but I am confused about the x and y position, since pointdefence can be un-attached and made to follow the player. So can someone help me with creating a position packet for a turret? I should be able to take it from there.
Cheese - Sun Feb 15, 2009 4:17 pm
Post subject:
where did you find the pd src?
D1st0rt - Sun Feb 15, 2009 5:24 pm
Post subject:
What exactly are you trying to do? If you want it to fire something else, you can just change the weapon (look at addTurret).
Initrd.gz - Sun Feb 15, 2009 5:30 pm
Post subject:
@Cheeze: Someone asked for help on how to create a turret and dr brain gave him the source. Search the forum.

What I am trying to make is a fake player that attaches onto a ship and can fire guns, bombs, bursts, thors, and repels. I want to know how to make the fake attach to a player and rotate.
CaptainPoopface - Sun Feb 15, 2009 6:09 pm
Post subject:
That's exactly what I wanted to know too... Dr. Brain kindly provided his pointdefense source as a reference, but it's intertwined with other Hyperspace modules and not meant to drop directly into ASSS. It's a bit over my head right now to try and implement something similar, even with his code as a guide. He claimed it was buggy as well, although it sure looks good in Hyperspace.


Also look at the funky/autoturret.c for a turret that automatically aims and fires L1 bombs (easy enough to change what it shoots). Wish I could figure out a way to detect projectile collision for it so I could kill it.
Initrd.gz - Sun Feb 15, 2009 6:16 pm
Post subject:
CaptainPoopface wrote:
That's exactly what I wanted to know too... Dr. Brain kindly provided his pointdefense source as a reference, but it's intertwined with other Hyperspace modules and not meant to drop directly into ASSS. It's a bit over my head right now to try and implement something similar, even with his code as a guide. He claimed it was buggy as well, although it sure looks good in Hyperspace.

Point defense's usage of hscore is minimal. I will send you mine once I complete it, as you can fire more than guns and bombs, and it will have more settings (eg. make it fire directly in front of you, useful when rushing.)


CaptainPoopface wrote:
Also look at the funky/autoturret.c for a turret that automatically aims and fires L1 bombs (easy enough to change what it shoots). Wish I could figure out a way to detect projectile collision for it so I could kill it.

There's a module called "damage" that allows you to track damage to fake players. Here's the page: http://toktok.sscentral.com/ss-asss.html
Initrd.gz - Thu Feb 19, 2009 8:15 pm
Post subject:
Soo... Can anyone tell me how to create the turret packets? First, what is the packet? Is it the C2SPosition struct, or is it something different?

I looked in the pd source, and I see that it sends a SimplePacket once when it attaches, but how do you tell it to rotate?
Samapico - Thu Feb 19, 2009 9:38 pm
Post subject:
Probably make it send position packets?

Just a guess
Initrd.gz - Thu Feb 19, 2009 10:31 pm
Post subject:
Yeah, thats what PD looks like its doing, but what do I put for the X and Y values? Could I copy off of the attached player?

PD does this for xspeed and yspeed

Code: Show/Hide
   int deltaTime = current_ticks() - data->pos.time;
   int v_x = data->pos.xspeed;
   int v_y = data->pos.yspeed;
   int x = data->pos.x + deltaTime * v_x / 1000;
   int y = data->pos.y + deltaTime * v_y / 1000;

data->pos is the owner's position packet.
Samapico - Fri Feb 20, 2009 1:07 am
Post subject:
so that's what it does, it gives the same x/y than the player... because when you detach the PD, it keeps following you

the + deltatime thing is just to put the turret a bit in front of the player (or right on him, if the last known data about the player is a bit old)
Initrd.gz - Fri Feb 20, 2009 12:43 pm
Post subject:
Ah, k. I'll just copy that.

I'll let you know if anything else goes wrong.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group