Server Help

ASSS Custom Projects - <c> drone

Bak - Wed Jul 27, 2005 1:50 pm
Post subject: <c> drone
I've released the AI drone code from my server on http://rshl.org/open/index.php?topic=7.msg217#msg217

Breifly, it's an AI drone that walks around and shoots and can die. There's lots of little things that should be fixed, but I'm not going to fix since I don't think I'm using this interface / ai anymore. If you improve this interface I ask that you make it public too, for the good of subspace, but do whatever you want.
Mine GO BOOM - Wed Jul 27, 2005 6:17 pm
Post subject:
Copy of rar file for those that don't want to register to get it.
Bak - Wed Jul 27, 2005 8:23 pm
Post subject:
You have to register to get it? hmm
i88gerbils - Wed Jul 27, 2005 10:28 pm
Post subject:
This interests me as I'd like to create a stationary turret that shoots at things with various levels of firepower, energy, etc ... It would probably be best paired up as something you can ?buy. Err right on that last one :D.
BB - Mon Sep 05, 2005 1:25 am
Post subject:
I've downloaded and compiled this. I put the file Drone.dll into my bin directory, and then added Drone:drone to my modules.conf. My [ Modules ] section of arena.conf looks like this:

AttachModules = \
fm_normal \
points_kill \
points_flag \
points_goal \
buy
drone

When I entered the game the ?drone command doesn't do anything, or ?drone help. The ?buy drone command just comes back with Invalid item specified for purchase.

I didn't modify the code at all, just compiled it as is, 0 errors and 0 warnings. The Drone.dll file is 54.3 KB.

Is there something I'm doing wrong?

Thanks in advance for any replies.


*edit* Using Asss 1.4.0. Everything is still set up as default except the map file. *edit*
Bak - Mon Sep 05, 2005 2:46 am
Post subject:
you're missing a backslash:

AttachModules = \
fm_normal \
points_kill \
points_flag \
points_goal \
buy \
drone

basicly, you need to add an ai to the interface (see simple.c), and then spawn a drone... looking at the interface funcs

Code: Show/Hide

void (*addDrone) (
      void (*aiFunc)(DroneData data, DroneSettings *ds, DroneAction* action, byte* perDroneData),  // packet function
      void (*actionFunction) (Player *p, const char *params, const Target* target, byte* perDroneData), // ?drone <param> function
      const char *name, // name used for when buying the drone
      const char *aboutText, // ?drone about text
      const char *helpText, // ?drone help extra text
      u32 bytesToAllocate, // amount of per drone data (int bytes) to allocate, use 0 to not allocate any memory
      int bulletlevel, // 1-3
      int bomblevel, // 1, for now
      int cost // how much does it cost to ?buy your drone
      );

   void (*removeDrone) ( const char *name ); // remove the drone with this name, used during your modules unloading

   // These next functions are how the server interacts with the drone modules, don't use these when designing your AI:
   void (*sendDroneCostInfo) (Player *p); // send the cost information to a player
   BOOL (*isDroneOwner) (Player *p); // is this player a drone owner?
   int (*getCost) (const char *type); // returns cost or -1 if not found
   BOOL (*spawnDrone) (Player *p, const char *type); // spawn a drone at the player's current position, true iff found type and spawned


use addDrone and then use spawnDrone to spawn it

the whole cost system was just because that's how I used it. It could easily be removed as it is not implemented in this module (but rather, in a different one by using getCost and isDroneOwner)
Quan Chi2 - Mon Sep 05, 2005 5:52 pm
Post subject:
its for As3, right?
Bak - Mon Sep 05, 2005 11:40 pm
Post subject:
that's what this subforum is for, yes
Quan Chi2 - Tue Sep 06, 2005 1:08 am
Post subject:
lol yea.. i realized that after i posted tongue.gif
Kitsune (^) - Sun Nov 20, 2005 1:43 pm
Post subject: Okay.
I can't get it to work, can someone help me.. it won't attach to AS3...

So meh.
Cyan~Fire - Sun Nov 20, 2005 7:22 pm
Post subject:
Well I would help you but... meh.
Bak - Tue Nov 22, 2005 9:36 pm
Post subject:
if the fail part of the attach section, print out the address of every module that should have been loaded correctly. $5 says one of them was not loaded and should be placed in modules.txt before drone

The address will be 0 if it was not loaded correctly.
CaptainPoopface - Mon Jan 05, 2009 7:11 am
Post subject:
Sorry for bump, but I would really like to get this working. It looks like you've put a great deal of work into it, and I want to play with it.

I cannot seem to spawn a drone. I've added the cmd_'s for addDrone, spawnDrone and removeDrone; put drone in the modules.conf AFTER objects, and referenced it in the arena.conf. The module attaches successfully. I try ?addDrone and ?spawnDrone (with no arguments) but nothing happens. What am I doing wrong?
Bak - Mon Jan 05, 2009 6:45 pm
Post subject:
addDrone and spawnDrone are interface functions, not asss commands. The only command used is ?drone, and the behavior is customizable by the specific drone type.

if drone is loaded and attached correctly (use "?lsmod -a" to check), load the simple module to spawn a drone (see simple.c in MM_LOAD for how to do this in code). use "?insmod simple" (or drone:simple or <dllname>:simple if you compiled it into a non-core .dll or .so)

that should spawn one drone which follows enemies and shoots at them (I think the bounty is the drone's energy).


the following behavior looks incomplete which is weird. If you want to be able to do "?drone follow" you'll need to code the droneAction function to populate the PerDroneData.playerToFollow field, although there's no notion of ownership with the simple bot
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group