fiend-o-hell
Junior Member

Posts: 248
Registered: 01-06 |
The problem with your script is that it will just keep piling on weapons. I bet that if the game runs long enough, your map will crash. Also, their is no down period after pickup. Finally, its of type (void). It would most preferable if it ran from the start of the map. If you really want to re spawn items through ACS, you can use this script I made:
code:
/*
DISCLAIMER: THIS ITEM RESPAWN SCRIPT WAS WRITTEN BY fiend-o-hell (aka
FoH) AND THUS YOU MUST GIVE CREDIT WHERE CREDIT IS DO. DO NOT REMOVE
THIS DISCLAIMER WHEN PORTING OR MODIFYING THIS SCRIPT. OTHERWISE, I
WILL BE DISPLEASED WITH YOU! OTHER THAN THAT, USE TO YOUR HEARTS
CONTENT!
*/
//item spawn script
#define ITEM_START 100 //TID start range of respawn item
#define ITEM_END 102 //TID end range of respawn item
#define RESPAWN_START 1 //spawn spot start
#define RESPAWN_END 3 //spawn spot end (for reference only)
/*LEAVE ALONE*/#define ITEM_AMT ITEM_END-ITEM_START+1 //amount of items to respawn
/*OPTIONAL*/#define ITEM_CHECK 100 //length of time before respawn script restarts
/*OPTIONAL*/#define ITEM_DOWN 8 //amount of item checks that go by until item is respawned
str respawnItems[ITEM_AMT] = {"Shotgun","Chaingun","Clip"};
int downTime[ITEM_AMT]; //acts as both a tracker and a counter of downed items.
//0 means item has not been picked up.
script 950 OPEN
{
int itemPos = 0;
int spawnPos = RESPAWN_START;
for( int i=ITEM_START; i <= ITEM_END; i++)
{
str item = respawnItems[itemPos];
//if item is down (counter not at zero)
if( (downTime[itemPos] < ITEM_DOWN) && downTime[itemPos] )
downTime[itemPos]++;
else downTime[itemPos] = 0; //reset counter
//check if item exsists & not down
if( !ClassifyActor(i) && !downTime[itemPos] )
{
SpawnSpot( item, spawnPos, i, 0 );
downTime[itemPos]++; //start down time
}
itemPos++;
spawnPos++;
}
delay(ITEM_CHECK);
restart;
}
Its ready to copy paste into any map. Here is a quick explanation on how to use:
1. set the constants (the #define lines) first unless those lines have LEAVE ALONE warnings.
The spawn spots and the items will each have to have their own TID assigned. Make sure the TID ranges you pick are free and are consecutive.
Assign Spawn spots their TID in the editor. You should not assign weapons a TID since they do not exist yet. That is done by SpawnSpot(). Just make sure to reserve a range with ITEM_START and ITEM_END.
You can modify the down period (period after item pickup) if you want (note the OPTIONAL).
2.Fill respawnItems[ITEM_AMT] string array with items you want to spawn. The order in the array corresponds to the spawn spot TID order
3.(optional)add additional effects to the SpawnSpot() line (such as sound and or spawn fx).
And their you go!
Last edited by fiend-o-hell on 02-07-12 at 22:01
|