Announcement

Collapse
No announcement yet.

Teleport To One of many Set locations? (updated)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Teleport To One of many Set locations? (updated)

    In the mod i'm currently working on there will be the need for the random spawning of the Bomb (from bombing run). The way I thought about doing this is creating a Placeable and placing it in specific areas on my level. Then creating a bit of code that randomly seeks out one of the locations and spawns the bomb there.

    If anyone has really good solution for this i'd be willing to listen =D.

    Here's what I need to know exactly:

    1) What kind of code do I need inorder to have it randomly spawning at one of the placeable locations.

    2) Is this the most effective way of doing this?

    thanks,
    Michael

    --

    I've been working and I think I almost have it done..

    var int spnVar1;
    var int spnVar2;
    var xDSpawner Test00;

    //Reset Both counters
    spnVar1=0; //Counts Total
    spnVar2=0; //Determining Spawn Variable
    //Run a Count on TOTAL Random Spawn Locations
    ForEach DynamicActors(class'xDSpawner',Test00)
    {
    spnVar1++; //Max spawn points
    }
    //Choose a Random Spawn
    spnVar2=rand(spnVar1);

    //Reset Main Counter
    spnVar1=0;
    ForEach DynamicActors(class'xDSpawner',Test00)
    {
    if (spnVar1 == spnVar2) {
    //location pointer
    }
    spnVar1++;
    }

    xDSpawner is a placeable I created that extends actor which contains no code in itself. how do i call upon the location of the randomly chosen xDSpawner?

    --

    nevermind haha.. figured it all out myself =D
    my god.. *dies*

    Michael
Working...
X