View Full Version : Invisible Spawn problem ...

06-16-2010, 07:35 PM
Hi. Well, now I have spawned a couple of Mandalorians somewhere and curiously they are invisible, like if they have stealth generators but they don't. Even spawning them with player_male aspect or commoners aspect without any armors or mandalorians armors still show them invisible.
oh and fighting them don't turn them visible either ...

I've used the same scripts in other modules and that didn't happen :confused: ...

ideas? thanks on advance :)

06-16-2010, 07:59 PM
What module are you using? And what modules did this work in?

06-16-2010, 08:58 PM
I have tried in both the Dxun jungle and the Dxun landing modules, first I thought the stealthy mandalorians in the jungle module could be affecting somehow the spawns but later I tried in the landing module and invisibility persists.

Previously it worked in a Telos polar module, inside Atris academy.
It's very strange because even the bodybags doesn't appear :fist: ...

thanks :)

06-16-2010, 09:17 PM
Are you sure that the scripts are correct? No typos, or wrong scripts?

06-16-2010, 10:38 PM
this script is for on Notice field of the utcs:

// script for OnNotice script field in Scripts tab for 2 mandalorian in Dxun jungle mod

#include "k_inc_generic"

void main() {

int bRun;
float fRange;
float fTimeout;

// Get object reference to the NPC I just spotted.
object oSeen = GetLastPerceived();
object oPC = GetFirstPC();
object oMaS = GetObjectByTag("ff_mandscout2");

// If the character I see is the player character ...
// AND I haven't already done this...
if (GetLastPerceptionSeen() && oSeen == GetFirstPC() && !GetLocalBoolean(OBJECT_SELF, 50)) {

// Set that I've done this...
SetLocalBoolean(OBJECT_SELF, 50, TRUE);

// Stop doing anything I'm currently doing.

// Attacks PC when seeing him/her
AssignCommand(oMaS, GN_DetermineCombatRound(oPC));

// Not seeing the player, or this has already been done. Do standard AI instead.
else {
ExecuteScript("k_ai_master", OBJECT_SELF, 1002);

and this one spawn the mandalorians:

void main() {

float x1=-69.60f; // 1 mandy coords
float y1=68.54f;
float z1=120.195f;
float o1=254.27f;

vector vecNPC=Vector(x1,y1,z1);
location locNPC=Location(vecNPC,o1);

// set coordinates for 2nd mandalorian
float x2=-62.85f;
float y2=63.428f;
float z2=120.214f;
float o2=202.34f;

vector myVe2 = Vector(x2,y2,z2);
location locNPC2 = Location(myVe2, o2);

// create new mandalorians
object oNPC=CreateObject(OBJECT_TYPE_CREATURE,"ff_mandscout",locNPC);
object oNPC2=CreateObject(OBJECT_TYPE_CREATURE,"ff_mandscout2",locNPC2);


and there's one more for the On Spawn field, I'll post it later ... :)

so? :raise:

06-16-2010, 11:08 PM
Uh....... :confused: I'm not very good with scripts. I've only made 5 scripts, 2 of which I think don't even work, so I can't really help you, so ask a scripting expert. Sorry. :giveup: But I'm not at my best right now. I'm having a migraine. Just, I hope you find and fix your error.

Qui-Gon Glenn
06-19-2010, 10:07 PM
I don't see any logical errors in the script, but it does seem a little clunky with too many unnecessarily declared variables. If you are only calling those vector locations one time, it is far more efficient to simply use the coordinates in your vector call rather than load it with one-use statically assigned variables.

However, the above quibble has nothing to do with what is not working... unless it is the extra spaces in your last two lines (I'm sure this is a copy/paste error, but maybe not). Note that scout has extra spaces....

06-20-2010, 10:49 AM
Yeah some unnecessary variables were kept from the script I edited, and thanks for clearing the vector locations issue. Anyway, as u said, I don't see any relation with the fact that my mandalorians are spawned invisible, it's like their texture is missing or something but they're not. Or like if they had stealth devices activated but they don't have.
So, everything works (the spawn, the mandalorians attacking me as they should, EXCEPT this very odd invisibility issue).

Here u have to take a look at the OnSpawn script, although it's just the default k_def_ambmob one with comments in or out to walk randomly:

//:: k_def_ambient
Inteligent Ambient Custom On Spawn In Script

#include "k_inc_generic"
#include "k_inc_debug"

void main()
// WALK WAYPOINT BEHAVIORS (Comment In or Out to Activate ) ************************************************** **************************
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_STOP) ; //Causes the creature to pause for 1 - 3 seconds at a waypoint
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_STOP_ LONG); //Causes the creature to pause for 6 - 12 seconds at a waypoint
//GN_SetSpawnInCondition(SW_FLAG_WAYPOINT_WALK_STOP_ RANDOM); //Causes the creature to pause for 1 - 12 seconds at a waypoint
//GN_SetWalkWayPointsSeries(1); //If this function is uncommented a number from 1 to 99 must be passed. This number represents
//a waypoint series that uses the string "01" through "99" instead of the creature's tag.
// eg. WP_22_01 through WP_22_05. 22 is the series number set with this function.

//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
//When a creature with this flag is talked to a computer dialogue will come up instead of the usual screens.

The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_HEARTBEAT) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_PERCEPTION ); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_ATTACKED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DAMAGED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DISTURBED) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_COMBAT_ROU ND_END); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DEATH); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DISTURBED) ; //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_BLOCKED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1009
//GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_FORCE_AFFE CTED); //OPTIONAL BEHAVIOR - Fire User Defined Event 1010

// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ************************************************** ***************************************


GN_SetListeningPatterns(); //This function although poorly named sets up the listening patterns and other important data for the
//creature it should never be removed.

thanks :)