Script to spawn placeables at MULItiple waypoints


#21

Where does the original script posted get the actual area (oArea)?

Just curious.


#22

Claudius - - - I tried your code so as not to limit to just 12 WP if desired . . … and for some reason only 12/15 will spawn . … . double checked the wp tags too . . …

void main()
{
object oPC = GetEnteringObject();
	object oTarget;
	int n;
		
	if ((GetIsPC(oPC) || GetIsDM(oPC) || GetIsDMPossessed(oPC)) && !GetLocalInt(OBJECT_SELF, "DoOnce"))
	{
	
   int n = 0;
object oTarget = GetObjectByTag("wp_qst_arsa_bwmush");
while (GetIsObjectValid(oTarget))
{
    CreateObject(OBJECT_TYPE_PLACEABLE, "qst_arsa_bw_mshrm", GetLocation(oTarget));
    n++;
    oTarget = GetObjectByTag("wp_qst_arsa_bwmush", n);
}
}
}

#23

See this pinned thread.

TR


#24

Have you put 3 additional waypoints on your map and checked they have the exact same tag? I do use that kind of script in my mods, to spawn opposition, special effects, … I usually have a very few opponents during the test phase then add additional waypoints (by copy/paste) to fine tune combats.

BTW in your script n is defined two times. Don’t know if it could have a side effect.


#25

it’s not hurting anything where it is. but it’s bad practice - declaring a var twice (c# specifically disallows it, etc.). It’s called “shadowing” a variable.

yes i’ve been bittin …

but in the code above its benign. ( To correct it, delete “int n;” )

( edit: and “object oTarget;” )


#26

Thanks for the clarification, kev.


#27

/cheers

nifty script btw. It really simplified the probl,