As promised I am attaching a new download here to include a working demo level .fpm file showing the load/unload functions in action.
With this a user should be able to open the level file and see exactly how the entities need be set up by studying the setting for each so that they can understand more easily how it works and apply the same procedures to their own game levels if they wish.
Everything you need is in the one download. The level uses default media.
To use this after download :
1. Copy the script files into a script folder inside FPSC - the main scriptbank one if you want.
2. Copy the .fpm into your mapbank folder.
3. In FPSC editor open the map file (.fpm)
4. In editor window zoom out until you can see all objects. To the right you see a box behind the player marker - the box is just a positional marker itself.
To the left you see 4 boxes - they are the ones that Load/unload (spawn/destroy/respawn).
In the middle you will see a small room segment with a dark floor tile in front and a trigger placed over it. That trigger zone is the entity which activates the load/unload functions attached to your box entities.
5. Now before you do anything else you may need to make sure that all of your entities can reference the needed script files you have copied into your directories as no doubt they may be located in a different place on your computer to where they are on mine - so right click each entity in turn and in the entities properties dialogue box click the option next to the relevant script files and loctate the correct scripts as named in the text fields.
Once done you are ready to go - you should not need to do anything else.
6. Test run the level. When it loads you should be looking towards an area where the 4 boxes will spawn or load but they are non existant to start with. As said you need activate them - and once only is all is needed. So walk over to the single room segment where the invisible trigger zone is located on the dark floor tile. When the player gets to the trigger the 4 boxes are activated and should come into existance if you are too far away from them move towards their position and they will appear. This is controlled by distance settings in script so you can edit the relative distance suitable for your own use - I find my defaults to be suitable for most of my requirements.
Now that the boxes exist you need to move away from the boxes - back in the direction from which you came (any will do in real game) which is why I placed the box marker at the player start position - move back in that direction - best backwards whilst facing the 4 boxes so you can see what happens.
The 4 boxes should now dissapear when you get close to the start location where the box marker is.
So we have spawned or loaded and destroyed or unloaded the boxes. But what if in our game we want to go back into a room where the boxes existed - they would now be gone - well not really as we can load them again.
Simply face the position where the 4 boxes were and walk forward towards them and they will load up or spawn again - back up and they will dissapear again and so on.
In this demo they are set to respawn 99 times and that should be enough for most games but you can adjust this in the entities properties in editor.
Again Please Note : once activated by the trigger zone and scripts they will remain active until no more spawns are available - you only need enter the trigger zone once and only one is needed - so if you have a room with door in and door out say the single trigger zone would only need be placed outside on the approach to the room at a suitable distance from the first entry door a player encounters on his way to the room - then when the player gets to open the door and enters the room the boxes or any other entity with these scripts applied having the same entity name which would not have existed before trigger activation now exist and will always do so if the player enters the room and will be removed when he exits.
Remember for that to be so you may have to adjust the distance settings in script and set up your levels accordingly.
I would suggest that you make backups of the download files and keep them safe and also print this post contents for reference.
Do not be tempted to cut corners and use any old trigger zone activation script - it wont work - use the supplied activate1.fpi script file.
I dont support this in great detail and theres no need to - thats why you now have the demo - and its not rocket science.
Hope that helps and good luck with your endeavours.
"I am and forever will be your friend"