Aller au contenu

Photo

Spawning Creature At Spawn Point!


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
TemplarDrake

TemplarDrake
  • Members
  • 18 messages

So here is a bit of a head scratcher for me and my team! We've been trying to create a Fairy that has a chance to appear when a player walks over an encounter. All fun and games.

 

However is there really no way of making it spawn with the spawn and not where the PC runs over the encounter?

 

Thanks!

 

- Drake



#2
Kato -

Kato -
  • Members
  • 392 messages

Do you mean that the fairy spawns near the player walking on the trigger? I have not used trigger encounters for years but I recall that when this happened was because the encounter had no spawn point or it was badly placed(inaccessible or too close to trigger). For utmost flexibility and speed you should consider using a spawner over trigger encounters, as a suggestion.

 

 

Kato 



#3
kalbaern

kalbaern
  • Members
  • 824 messages

Sounds like you need to put your random fairy spawn into the OnEnter event of the spawn trigger for your counter. I'd also suggest having the fairy spawn to a waypoint or placeable near where the normal spawn appears.



#4
GhostOfGod

GhostOfGod
  • Members
  • 863 messages

Depending on how you want it to work exactly, could be something as simple as:

 

void main()
{
    int iPercent = Random(100)+1;
    object oSpawnPoint = GetWaypointByTag("tag of waypoint to spawn fairy");
    location lLocation = GetLocation(oSpawnPoint);

    if (iPercent <= 10) //10 percent chance to spawn the fairy
    {
        CreateObject(OBJECT_TYPE_CREATURE, "fairy res ref", lLocation, TRUE);
    }
}

 

...placed into the "OnEnter" of a trigger. And you would just need to put a waypoint somewhere with a unique tag and put that tag in this script. As it is, it would trigger every time anyone entered the trigger so you could put a delay in there too to make it so you have to wait awhile before you get another chance to spawn it. Or you could make the 10% chance higher or lower, etc, etc.