Server Help

ASSS Custom Projects - Sending Weapons Packets

tcsoccerman - Thu Jul 24, 2008 9:09 pm
Post subject: Sending Weapons Packets
I've searched vigoursly for a topic that explains how to send/create a bullet or bomb packet with no luck. Basically here's what my intentions are:

Create a fake player(Completed).
Create a weapon packet (Completed).
Make it look like that fake player is shooting the weapon packet(Not completed).

I have a feeling that net->SendToOne/Set/Arena() has something to do with this but some examples i've seen use that to kill players (such as hscore->kill module).

Thank you.
Dr Brain - Fri Jul 25, 2008 9:16 pm
Post subject:
Look at my kill module: http://forums.minegoboom.com/viewtopic.php?t=8092
tcsoccerman - Fri Jul 25, 2008 11:32 pm
Post subject:
yes i did and it helped alot. the only thing is i don't want to kill anyone, i just want them to shoot a bullet. hmmm it's making sense now. i would just not place the weapon packet in a position to kill.

now if i want the weapon packet to be seen/affected by the whole arena would i do SendToArena though.

and do i have to put the packets in a loop like i do for the position packet on my turrets.

ty for helping.
Bak - Sat Jul 26, 2008 2:08 am
Post subject:
do you want to send the weapon packet more than once?
tcsoccerman - Sat Jul 26, 2008 8:45 am
Post subject:
no, i just didn't know if i needed to update the weapons packet or it would "dissapear".
tcsoccerman - Sat Jul 26, 2008 7:56 pm
Post subject:
alright i got it all working. the problem before was i was accidently making me an exception in sendtoarena so i wasn't seeing anything.

now the thing is whenever the weapon packet is sent, the playerid in the struct gets warped too the location (x and y in the struct) of the weapon packet location. i don't want that but i do want the playerid of the struct to get the kill reward. is their a fix for this?
Dr Brain - Sat Jul 26, 2008 11:14 pm
Post subject:
If you send a packet to the player, they'll warp. Your choice is to not send them the weapon, or to warp them.

To not send it to them, there's an argument for net->SendToArena that needs to be the player you *don't* want it sent to. It's probably NULL at the moment. Look at the documentation in net.h.
tcsoccerman - Sun Jul 27, 2008 12:06 pm
Post subject:
but then they don't see it, that's the problem. they also change ships, for some reason(when they warp).

so if they have to warp or not see the weapon, bots can now do something asss can't.

also, do fake players have pid's? what if i set it to -1?
Dr Brain - Sun Jul 27, 2008 12:46 pm
Post subject:
tcsoccerman wrote:
but then they don't see it, that's the problem. they also change ships, for some reason(when they warp).


I now have no idea what you're talking about.

tcsoccerman wrote:
so if they have to warp or not see the weapon, bots can now do something asss can't.


Don't take your buggy module to mean no one else can do it.

tcsoccerman wrote:
also, do fake players have pid's? what if i set it to -1?


Yes. Setting it to -1 will have odd results.
tcsoccerman - Sun Jul 27, 2008 1:12 pm
Post subject:
sorry,

I did get it to work by setting the weapon packets pid to the fakeplayer's pid. sorry for making any offensive assumptions doc. your post before that mis-made me think that it was not possible in asss.

thanks for all you're help.
Dr Brain - Sun Jul 27, 2008 2:34 pm
Post subject:
Glad you got it resolved. Everything in SS uses pids, so you really have to make sure you get them correctly set, especially if you ever do any work with the attach packets.
hellzlaker - Sun Jul 27, 2008 2:57 pm
Post subject:
hm this is a bit offtopic, but tcsoccerman is halo going to be ASSS since i see you working on different modules :\
tcsoccerman - Sun Jul 27, 2008 8:52 pm
Post subject:
you're assuming this isn't for halo. yes, it's for a different zone but will quite possibly be used in halo after a few changes.
hellzlaker - Sun Jul 27, 2008 11:37 pm
Post subject:
This isn't what i meant I was just asking if halo was ASSS or SubGame, and i meant to say "i think its ASSS because your working on modules instead of bots"
tcsoccerman - Mon Jul 28, 2008 9:20 am
Post subject:
yes this is asss. that's why it's in asss custom projects forum.
tcsoccerman - Mon Aug 04, 2008 3:30 pm
Post subject:
as far as bombs go, i'm trying to set a velocity to the weapons packet but the pid is being velocitized not the bomb. why is this?

Code: Show/Hide

void FireWeapon(struct TurretData *td, int type, int level)
{
     chat->SendArenaMessage(td->arena, "Creating Weapon Data");
     
     struct S2CWeapons packet;
     
    packet.type = S2C_WEAPON; /* 0x05 */
    packet.rotation = td->FakePlayer->position.rotation;
    packet.time = 500;
    packet.x = td->FakePlayer->position.x;
    packet.yspeed = -500;
    packet.playerid = td->FakePlayer->pid;
    packet.xspeed = -600;
    packet.checksum = 0;
    //u8 status = STATUS_STEALTH | STATUS_CLOAK | STATUS_UFO;
    packet.c2slatency = 0;
    packet.y = td->FakePlayer->position.y;
    packet.bounty = 0;
   
    packet.weapon.type = type;
    packet.weapon.shrapbouncing = 1;
    packet.weapon.shraplevel = 2;
    packet.weapon.shrap = 31;
    packet.weapon.alternate = 1;
     packet.weapon.level = level;
     
     Player *p;//null player to except
     
     net->SendToArena(td->arena, td->FakePlayer, (byte*)&packet, sizeof(struct S2CWeapons) - sizeof(struct ExtraPosData), NET_RELIABLE);
}

Dr Brain - Tue Aug 05, 2008 7:57 am
Post subject:
In the settings, bombs have fixed bomb speeds. If you need to send a bomb at a specific speed, make the player travel that fast minus the bomb speed.
tcsoccerman - Tue Aug 05, 2008 4:10 pm
Post subject:
is it possible to send a bomb at any speed without moving the player?

it seems whenever i set packet.x/yspeed to anything those values are applied onto the player with pid of packet.pid, and whenever i do not set those values, the bombs turn into mines and don't move.

thank you.
Dr Brain - Tue Aug 05, 2008 5:43 pm
Post subject:
No.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group