Apothem Posted January 26, 2009 I've given this code out kinda under the radar, and after giving it out last time, I said I'd release a public version. Out of any script I've made, this one gets used more, next to the HP Bar. So, here it is, the Halo shielding system. Complete with MP compatibility in ZDoom and Skulltag. You are also able to customize it a bit and put in your own custom armor types etc for any other special effects you'd like to try. You are free to use this, but please credit those who deserve it. http://www.megaupload.com/?d=EBPD52DA code:#include "zcommon.acs" #define RECHARGEDELAYTIME 105 //delay before the recharge takes place. #define RECHARGETIME 1 //delay between each addition of shield hit points #define MAXPLAYERS 32 #define SHLDREGEN 600 #define SHIELDING 601 int isrecharging[MAXPLAYERS]; script SHLDREGEN (int pnum) //Recharging script. { if (getactorproperty(activatortid(), APROP_Health) <= 0) { terminate; } int oldval = getactorproperty(activatortid(), APROP_health); if (isrecharging[playernumber()] == 0) { localambientsound("recharge", 127); isrecharging[playernumber()]++; } for (int a = checkinventory("armor"); a < 100; a++) { if (checkinventory("armor") < a || getactorproperty(activatortid(), APROP_health) < oldval || getactorproperty(activatortid(), APROP_Health) <= 0) { isrecharging[playernumber()] = 0; terminate; } if (getactorproperty(activatortid(), APROP_health) > oldval) { oldval =getactorproperty(activatortid(), APROP_health); } oldval = getactorproperty(activatortid(), APROP_health); giveactorinventory(activatortid(), "shieldlvl1", 1); delay(rechargetime); } isrecharging[playernumber()] = 0; } function str chkshield (int pnum) //this function is to be used for custom shielding values - mostly for the APS { return "shieldlvl1"; //if you want to adjust the armor resilience or anything, just change this to your custom armor bonus. //if you wanted to check for other conditions as well, this would be the best place to put your checks. } script SHIELDING (int pnum) //status check script { int acounter; int oldhp = getactorproperty(activatortid(), APROP_health); int oldval = checkinventory("armor"); While (checkinventory("armor") == oldval) //counter loop to make sure the charging process isn't interupted. { acounter++; delay(1); if (acounter == RECHARGEDELAYTIME && checkinventory("armor") < 100) //if the loop has reached it's proper delay time (in tics) { acs_executealways(SHLDREGEN,0,playernumber(),0,0); break; } /* if(checkinventory("armor") == 0) //failed attempt at trying for the dead beep. Try again next time charlie. { delay (4); localambientsound("deadbeep",127); acounter += 4; }*/ if (checkinventory("armor") < oldval || getactorproperty(activatortid(), APROP_health) < oldhp) //if the armor or health changes it resets the countdown { if( checkinventory("armor") < oldval && getactorproperty(activatortid(), APROP_health) == oldhp) localambientsound("ohshit", 127); acounter = 0; oldval = checkinventory("armor"); oldhp = getactorproperty(activatortid(), APROP_health); } if (getactorproperty(activatortid(), APROP_health) > oldhp) { oldhp = getactorproperty(activatortid(), APROP_health); } if (checkinventory("armor") > oldval) { oldval = checkinventory("armor"); } if (getactorproperty(activatortid(), APROP_Health) <= 0) { break; } } if (getactorproperty(activatortid(), APROP_Health) >= 1) { delay(1); restart; } } Script 1 ENTER //This script is just meant to initialize the system. { thing_changetid(0,1000 + playernumber()); acs_executealways(SHIELDING,0,0,0,0); } Script 601 RESPAWN { thing_changetid(0,1000 + playernumber()); acs_executealways(SHIELDING,0,0,0,0); } 0 Share this post Link to post
Dreadopp Posted January 27, 2009 This is pretty neat. I could probably find a use for this at some point. Nice work. :) 0 Share this post Link to post
Apothem Posted January 27, 2009 I appreciate it. I tried to make it as flexible as possible. With this model, you could potentially apply it to monsters too. Would make for one heck of a boss or elite unit or something. 0 Share this post Link to post
TMD Posted January 28, 2009 Interesting, but why do people keep trying to make DooM play like something else? 0 Share this post Link to post
Tango Posted January 28, 2009 Why not? Adding new gameplay elements can make things fun. 0 Share this post Link to post