Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CreateEntityAtArea problem
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#3
RE: CreateEntityAtArea problem

Rapture, your code should work. Perhaps the entity needs a unique name, though, so try:

    //Change your first bit of code to this
for(int i = 0; i <10; i++)
AddTimer("T"+i, i, "TimerFunction");

//Change your timer callback to this
void TimerFunction(string &in asTimer)
{
        AddDebugMessage("Creating object Create"+asTimer,false);
    PlaySoundAtEntity("scare", "react_scare.snt", "Player", 0, false);
    CreateEntityAtArea("Create"+asTimer, "vase01.ent", "ScriptArea_1", false);
}

Though note that this will create all the vases at one location. You should create multiple script areas and do the following:
//Change your first bit of code to this
for(int i = 0; i <10; i++)
AddTimer("_"+(i+1), i, "TimerFunction");

//Change your timer callback to this
void TimerFunction(string &in asTimer)
{
        AddDebugMessage("Creating object Create"+asTimer,false);
    PlaySoundAtEntity("scare", "react_scare.snt", "Player", 0, false);
    CreateEntityAtArea("Create"+asTimer, "vase01.ent", "ScriptArea"+asTimer, false);
}
(This post was last modified: 08-03-2011, 09:30 PM by Apjjm.)
08-03-2011, 09:25 PM
Find


Messages In This Thread
CreateEntityAtArea problem - by Rapture - 08-03-2011, 03:27 AM
RE: CreateEntityAtArea problem - by Kyle - 08-03-2011, 03:49 AM
RE: CreateEntityAtArea problem - by Apjjm - 08-03-2011, 09:25 PM



Users browsing this thread: 2 Guest(s)