ASSS Custom Projects - Attaching turret with aim and firing commands CaptainPoopface - Tue Dec 16, 2008 12:25 pm Post subject: Attaching turret with aim and firing commands
I would like to make a fake player that acts as your turret, meaning it flies on your ship and fires independently. I'd like to have commands to:
- tell it how many ticks to rotate clockwise or counterclockwise from current position, or a simpler workaround, tick once CW or CCW.
- make it fire a bomb in the direction it is currently pointing
- spawn/attach, and die/detach
- snap the aiming direction to N, S, E or W (least important feature)
For example,
?attachturret <playername>
?aimnorth
?cw 3 ;;rotate 3 ticks clockwise
?firebomb
?killturret
This doesn't seem too difficult, but I am new to ASSS and haven't coded for a long time. I've played with autoturret.c somewhat, but it is a bit mystifying to me exactly how the code works.
Is this feasible? Can someone point me in the right direction? For example, how to spawn a fake player and make him attach?
Thanks to MineGoBoom and other contributors for making this forum.
Samapico - Tue Dec 16, 2008 1:19 pm Post subject:
Hyperspace has this item you can buy they call 'point defense'
It's pretty much exactly what you're asking for, except its rotation speed isn't limited. It also fires bullets automatically on its own, no other ?command involved.
But I'm sure you'd have a nice head start with that.
tcsoccerman - Tue Dec 16, 2008 3:49 pm Post subject:
i've made an module that creates a fakeplayer as a turret. when someone enters a specific region, they control that turret by rotating or shooting guns and bombs.
unfortunately it's closed source for SSCC the CompleX. Maybe when the zone is public i will go open source with it.
CaptainPoopface - Tue Dec 16, 2008 10:52 pm Post subject:
Is the hyperspace point defense code publicly available? I found a post with some HS utility-related things, but they seemed more general (selfpos and kill), not directly related.
Samapico - Wed Dec 17, 2008 1:18 am Post subject:
<waits for Brain to answer>
Dr Brain - Wed Dec 17, 2008 6:33 am Post subject:
I never bothered releasing it because it's full of bugs that I've never gotten around to fixing.
I've attached it, but remember that there are more than a few bugs in the code. I suggest using it for reference, but not to copy code from it directly.
CaptainPoopface - Thu Dec 18, 2008 1:00 am Post subject:
Thank you for posting. It actually looks fairly intuitive. I saw it in action in Hyperspace and was impressed.
After compiling, I get an error when I try to attach the module:
E <cmod> error in dlsym: ./bin/asss: undefined symbol: MM_hs_pointdefense
What does this mean? And is it compatible with ASSS 1.4.4?
Dr Brain - Thu Dec 18, 2008 6:34 am Post subject:
You need to ?insmod whatever:hs_pointdefense, where whatever is the name of the .so or .dll file you compiled it into.
Anonymous - Wed Jan 14, 2009 6:36 pm Post subject:
Would anyone be willing to link me to a compiled .so of the pointdefence module?