Back to your problem, yes there is many ways we just need to know more like..
What are you useing? MMF or TGF?
What tpye of game are you trying to make?
and other stuff
Sounds like pretty basic stuff to me. From the limited info you gave the best I can surgest is:
>When enemy leaves screen - destroy
>On blaah Blaah trigger - Create enemy at blah blaa co-ordinate
This is code it. I want enemeies that dissapear when there not on the screen with the player and I want them to come back when the player reaches a certain spot in the level. Like in the old megaman games, the enemies could always come back, and in the same spots.
Then you would have objects (or just plain cordinates) so every 1(or how often to check) second if number is less then desired amount = create object at coridnates' pretty basic.
Now if you want it to identify objects with what point they are supposed to be at you have to create an event for each person now the best way for this to work is on start of level + object is over object you use to identify by (known as a spawning point) = set value of the enimie object to a number that relates to the identifier object, all ident objects MUST be diffrent for this to work.
then in the code
object alt value = 5
Number is less then desired amount
then
Make object at spawn point, and set value to 5
get it?
maybe some one can clarify if i am too criptic.
I think I know what you mean. You want enemies that don't move around unless they're on the screen with you, and you want them to come back if you've killed them and return to the same place, right? Very NES-ish.
Assuming there's more than one of each type of enemy, I'd do this:
Place an invisible active object where you want your enemies to spawn. At the beginnign of the level, assign each of these a random number (in, say, alterable value A). This will serve as an ID for each spawn point.
When the spawn point is (say)5 pixels from the edge fo the screen (or a set x and y distance from the player), create an enemy of it's type on top, and assign it the A value of the spawn point it's over. So a spawn point with avA=987 would only create enemies with avA=987.
If the enemy is not satisfying the condition of being a certain distance from the player (that is, outside the screen), then turn on a flag that tells it to stop moving (or self-destruct if the spawn point is also not on screen, if that's your aim).
When a spawn point comes back on screen, it tests for enemies with it's own A value. If none exist, that means it's been killed and it creates a new one. This might not be necessary if you choose to have enemies die when they go off screen. In that case you wouldn't need the ID number, I guess, but it'd be helpful to test if both the spawn point and enemy are on screen if you have spawn points near each other.
That's a little overcomplicated, but you get the idea.