Author |
Message |
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: 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. _________________ SubSpace Discretion: A Third Generation SubSpace Client
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Wed Jul 27, 2005 6:17 pm Post subject: |
|
|
|
|
Copy of rar file for those that don't want to register to get it.
Drone.rar - 15.26 KB
File downloaded or viewed 151 time(s)
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Wed Jul 27, 2005 8:23 pm Post subject: |
|
|
|
|
You have to register to get it? hmm
|
|
Back to top |
|
|
i88gerbils Oldbie Server Help
Gender: Joined: Dec 13 2002 Posts: 423 Location: OH Offline
|
Posted: 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. _________________ Oldbie Server Help
|
|
Back to top |
|
|
BB Newbie
Age:41 Gender: Joined: May 24 2003 Posts: 2 Location: Iowa Offline
|
Posted: 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*
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: 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
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)
|
|
Back to top |
|
|
Quan Chi2 Member of "Sexy Teenagers that Code" Group
Age:33 Gender: Joined: Mar 25 2005 Posts: 860 Location: NYC Offline
|
Posted: Mon Sep 05, 2005 5:52 pm Post subject: |
|
|
|
|
its for As3, right?
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Mon Sep 05, 2005 11:40 pm Post subject: |
|
|
|
|
that's what this subforum is for, yes
|
|
Back to top |
|
|
Quan Chi2 Member of "Sexy Teenagers that Code" Group
Age:33 Gender: Joined: Mar 25 2005 Posts: 860 Location: NYC Offline
|
Posted: Tue Sep 06, 2005 1:08 am Post subject: |
|
|
|
|
lol yea.. i realized that after i posted
|
|
Back to top |
|
|
Kitsune (^) Novice
Age:32 Gender: Joined: Sep 29 2005 Posts: 42 Location: Between Heaven and Hell. Offline
|
Posted: 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. _________________ If (Pi=Infinite 3 Infinitity)
Carpe diem!
Know thyself.
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Nov 20, 2005 7:22 pm Post subject: |
|
|
|
|
Well I would help you but... meh. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: 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.
|
|
Back to top |
|
|
CaptainPoopface Newbie
Joined: Dec 16 2008 Posts: 17 Offline
|
Posted: 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?
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: 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
|
|
Back to top |
|
|
|