[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting (Was First step or something)



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

#Friday 11 January 2002 20:10# Message from Steve Baker:
> The good thing about using scripting for AI is that you can edit the scripts
> while the game is running.  

Well, yeah - but you can do the same thing if you can stick the game in pause,
give the game a command like "reloadAI" which then calls a function that does
something like (off the top of my head)

    dlclose(aiFoo -> soHandle);
    if(NULL == (aiFoo -> soHandle = dlopen(.......))) {
        log error
        bomb
    }

    resolveSymbols(aiFoo);

Then carry on as normal. Of course, if multiple AIs use the same library, and 
each opens a copy, this needs a bit more work to make sure that all instances
of the library are closed (dlopen returns the same handle if a library is 
opened more than once) bute it's still possible..

But anyway, each to his own - I like the dynamic library method, other people
like interpreted scripts. If everyone was the same, life would be incredibly 
boring. IMO the only thing that really matters is that it gets the job done 
as well as you want it to be done. If it does I can't see what difference it 
matters which method you use ;)

Chris
- -- 
 .------{ http://www.starforge.co.uk }-----. .---------------------------.  
=[     Explorer2260, Designer and Coder     \=\ P: TexMaker, Draktar      \ 
=[_____[ Quod nesciunt eos interficiet ]____]==[ Stack: EEOeOeOeTmTmDD---- ]
- --
Of course there's no reason for it, it's just our policy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8P057twxr0HXns0wRAoDGAKCurLEpDT2aEtW/f/+7IoExPChxOQCfeqj4
mg4BRMFWncI2tRCeyumabKw=
=47f+
-----END PGP SIGNATURE-----