@Sui: Yes, i was talkin about creatunit issues as well. Sorry if i confused you somehow... i'll try a short version:
- know what types of units you'll want to create with 'createunit' during your mission
- place them in the editor, so their resources are loaded at mapstart
- DON'T DELETE them with 'deletevehicle' - it appears the resources don't get loaded at mapstart then
- use a dummygroup to create new units into, then let them join their appropiate groups after "this join grpnull" etc
I think that sums it up
[EDIT]
Ok, i made a little test because i heard so many reports and rumors lately about performance issues with 'createvehicle' that i can't remember what is right and what is wrong.
(i already edited my above list of sentences)
Try out my little test mission. Make a DIR under your /opflashpoint/users/<your_name>/ called Spawntest.intro and put the mission.sqm into it.
It shows how to create units during the mission without any lag. There's 1 east Soldier at mapstart with 'grp1=this' in the init line to provide an existing group to create units into. Plus all resources for an east Soldier are loaded, so no createunit-lag. After creation, all east Soldiers join grpNull.
A trigger counts how many enemies exist near you. When 10 east units are spawned, another trigger forces the mission to end. By changing values of the count trigger you can spawn more until you hit the OpF engine unit limit.
After watching the mission 1 time you can change things to test my above list:
- change the outside Soldier to another type, say, an Officer. You'll see that the 1st created Soldier is causing a lag because the "SoldierEB" resources need to be loaded first.
- or change the init line of the outside Soldier to "grp1=group this; deletevehicle this". That way the soldier is deleted right after mapstart. AMAZINGLY the 1st created soldier will still cause a lag. That shows (IMHO) that the engine is smart enough to see that even though the soldier exists, the player will never see him because he's deleted intime.
Hope this helps. Comments / Suggestions / Enhancements welcome.