Author Topic: Spawning Creature At Spawn Point!  (Read 371 times)

Legacy_TemplarDrake

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Spawning Creature At Spawn Point!
« on: February 09, 2015, 04:20:07 pm »


               

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



               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Spawning Creature At Spawn Point!
« Reply #1 on: February 09, 2015, 05:19:38 pm »


               

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 



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Spawning Creature At Spawn Point!
« Reply #2 on: February 09, 2015, 09:09:25 pm »


               

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.


               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Spawning Creature At Spawn Point!
« Reply #3 on: February 10, 2015, 03:07:18 am »


               

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.