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


Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to make an object apear [SOLVED]
Author Message
magersupie Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #1
how to make an object apear [SOLVED]

hi everyone
this is my first post here Big Grin
anyway i am a noob at scripting.
so i hope you could help me.
i want this object to apear , but nothing happens.
i don't get an error when i start the level so i hope someone here knows what to do
this is the script:

//===========================================
     // Starter's Script File!
     //===========================================

     //===========================================
     // This runs when the map first starts
     void OnStart()
  
{ AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1); PlayMusic("03_puzzle_secret.ogg", false , 1.0f, 0, 0, true);}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{ SetEntityActive("character_infected_1" , true);
PlaySoundAtEntity( "", "react_pant.snt" ,"Player", 0.0f , false);
PlaySoundAtEntity( "", "explosion_rock_large.snt" ,"Player", 0.0f , false);
PlayMusic("00_event_gallery.ogg", false , 1.0f, 0, 0, true);}

     //===========================================
     // This runs when the player enters the map
     void OnEnter()
     {
    AddUseItemCallback("", "R01_Key1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("mansion_1", false, true);
    PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);  }

void CollideScriptArea_2(string &in asParent, string &in asChild, int alState)
{
AddEntityCollideCallback("Player" , "ScriptArea_2" , "MonsterFunc1" , true , 1);
SetEntityActive("hanging_prisoner_1", true);
SetLightVisible("SpotLight_1", true);
}

     //===========================================
     // This runs when the player leaves the map
     void OnLeave()
     {

     }
(This post was last modified: 04-17-2011 01:18 PM by magersupie.)
04-16-2011 03:30 PM
Find all posts by this user Quote this message in a reply
Dalroc Offline
Member

Posts: 57
Joined: Mar 2011
Reputation: 0
Post: #2
RE: how to make an object apear

I'm sorry but I can't even read this.. please use some indentation..
04-16-2011 03:58 PM
Find all posts by this user Quote this message in a reply
MrBigzy Offline
Senior Member

Posts: 616
Joined: Mar 2011
Reputation: 8
Post: #3
RE: how to make an object apear

And can you tell us what item?
04-16-2011 04:37 PM
Find all posts by this user Quote this message in a reply
magersupie Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #4
RE: how to make an object apear

(04-16-2011 04:37 PM)MrBigzy Wrote:  And can you tell us what item?

ofcourse Smile

its hanging_prisoner_1 and spotlight_1

the script that i wrote is

void CollideScriptArea_2(string &in asParent, string &in asChild, int alState)
{
AddEntityCollideCallback("Player" , "ScriptArea_2" , "MonsterFunc1" , true , 1);
SetEntityActive("hanging_prisoner_1", true);
SetLightVisible("SpotLight_1", true);
}
04-16-2011 04:42 PM
Find all posts by this user Quote this message in a reply
MrBigzy Offline
Senior Member

Posts: 616
Joined: Mar 2011
Reputation: 8
Post: #5
RE: how to make an object apear

Since both of those aren't spawning, the area is the problem. Are you sure its named correctly?

I also don't see a collide callback for CollideScriptArea_2 there. Is it named in your map file or are you missing it?
04-16-2011 05:24 PM
Find all posts by this user Quote this message in a reply
magersupie Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #6
RE: how to make an object apear

(04-16-2011 05:24 PM)MrBigzy Wrote:  Since both of those aren't spawning, the area is the problem. Are you sure its named correctly?

I also don't see a collide callback for CollideScriptArea_2 there. Is it named in your map file or are you missing it?

i think that's the problem but i'm not sure how to do this.
04-16-2011 05:27 PM
Find all posts by this user Quote this message in a reply
MrBigzy Offline
Senior Member

Posts: 616
Joined: Mar 2011
Reputation: 8
Post: #7
RE: how to make an object apear

AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);

Like that one, but put:

AddEntityCollideCallback("Player" , "ScriptArea_2" , "CollideScriptArea_2" , true , 1);

Assuming your script area is named ScriptArea_2.
04-16-2011 06:45 PM
Find all posts by this user Quote this message in a reply
magersupie Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #8
RE: how to make an object apear

(04-16-2011 06:45 PM)MrBigzy Wrote:  AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);

Like that one, but put:

AddEntityCollideCallback("Player" , "ScriptArea_2" , "CollideScriptArea_2" , true , 1);

Assuming your script area is named ScriptArea_2.

hmmm this doesn't work eather Sad
do i need to put this on the exact same spot ???
04-16-2011 07:10 PM
Find all posts by this user Quote this message in a reply
MrBigzy Offline
Senior Member

Posts: 616
Joined: Mar 2011
Reputation: 8
Post: #9
RE: how to make an object apear

Put it below AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
04-17-2011 03:24 AM
Find all posts by this user Quote this message in a reply
magersupie Offline
Junior Member

Posts: 5
Joined: Apr 2011
Reputation: 0
Post: #10
RE: how to make an object apear

(04-17-2011 03:24 AM)MrBigzy Wrote:  Put it below AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);

thanks sooo much this worked Big Grin
04-17-2011 11:30 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)