I'm Confused...
#3533 posted by
ranger on 2025/01/05 15:27:24
can you give example code?
I keep getting the "host error pf precache can only be done in spawn functions?"
regardless of where I put the monster's precache ?
On A Side Note - For Dynamically Spawned Monster Placement We Can Try
#3534 posted by
ranger on 2025/01/05 15:37:00
spawny.origin_x = (0.5 - random())* 2 * 5000; //It's origin is randomized
spawny.origin_y = (0.5 - random())* 2 * 5000;
spawny.origin_z = (0.5 - random())* 2 * 5000;
while((pointcontents(spawny.origin) != CONTENT_EMPTY) && (spawny.aflag < 75))
{
//If the pointcontents of the monster origin is not empty, reset it To a more suitable space. If no space can be found within 75 loops,
//Leave it where it last was placed.
spawny.origin_x = (0.5 - random())* 2 * 5000;
spawny.origin_y = (0.5 - random())* 2 * 5000;
spawny.origin_z = (0.5 - random())* 2 * 5000;
spawny.aflag = spawny.aflag + 1;
}
Jazz Is About All The Notes He's NOT Playing
#3535 posted by
Preach on 2025/01/05 20:03:56
The important part is not where you put the precaches, but REMOVING them from everywhere except worldspawn. If you are really struggling, remove all the precaches of the model until you start getting a different error about a resource NOT being precached. Then add one precache to worldspawn and you should be set.