View Single Post
Old 01-10-2008, 04:27 AM   #31
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
I've actually been pondering just recently a better way to implement an alternate scripting for server-side all together (LUA, GM, Squirrel, or w/e you want).

But you'd want to consider the following:

Replace ICARUS ****.
Allow for server manipulation type stuff (that can be see in like ETPro, and other various games/mods)
As you can see, ICARUS is using a separate file for each script which is kind of messy and you would want to limit map scripts to just 1 script and do everything in that file.

For instance:

If you have some entity that has many scripts attached to it, instead of each file per "behavior set" you'd just have events set up as such:

GM could be like so:

Code:
some code above...

//note this. inside these functions would be accessing myEnt (I think) Might be events but not positive.

myEnt = FunctionToRetrieveEntity(params?);
myEnt.Events[EVENT.SPAWN] = function(SpawnTime) {
	//do some actions upon myEnt spawning
};

myEnt.Events[EVENT.USE] = function(UseEnt) {
	//do some actions when myEnt has been used
};

myEnt.Events[EVENT.AWAKE] = function(params?) {
	//do some actions when myEnt has awoken or been startled
};

myEnt.Events[EVENT.ANGER] = function(Enemy) {
	//do some actions when myEnt has found an enemy
};

myEnt.Events[EVENT.VICTORY] = function(Victim, MeansOfDeath) {
	//do some actions when myEnt has killed someone or something
};

myEnt.Events[EVENT.LOSTENEMY] = function(LastEnemy) {
	//do some actions when myEnt has lost its enemy
};

myEnt.Events[EVENT.PAIN] = function(Inflictor) {
	//do some actions when myEnt takes damage
};

myEnt.Events[EVENT.FLEE] = function(Health) {
	//do some actions when myEnt's health is below 50%
};

myEnt.Events[EVENT.DEATH] = function(Inflictor, MeansOfDeath) {
	//do some actions when myEnt has died
};

myEnt.Events[EVENT.DELAYED] = function(TimedDelay) {
	//do some actions when myEnt delayScriptTime has been reached (this could be done away with IMO and replaced with script delays...)
};

myEnt.Events[EVENT.BLOCKED] = function(BlockEnt) {
	//do some actions when myEnt is blocked by a friendly NPC or player
};

myEnt.Events[EVENT.BUMPED] = function(Bumpee, Radius) {
	//do some actions when myEnt is bumped by a friendly NPC or player
};

myEnt.Events[EVENT.STUCK] = function(BlockEnt) {
	//do some actions when myEnt is blocked by a wall
};

myEnt.Events[EVENT.FFIRE] = function(Victim, MethodOfDamage) {
	//do some actions when myEnt shoots at its teammates
};

myEnt.Events[EVENT.FFDEATH] = function(Victim, MeansOfDeath) {
	//do some actions when myEnt kills a teammate
};

myEnt.Events[EVENT.MINDTRICK] = function(Inflictor) {
	//do some actions when myEnt has been mind tricked by someone
};

some code below...


iojamp project lead / coder
ensiform is offline   you may: quote & reply,