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
Script Help Error with scripts
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: Error with scripts

Do like this;

PHP Code: (Select All)
void OnStart()
 { 
 
SetSanityDrainDisabled(true);

 
GiveItemFromFile("lantern""lantern.ent");

 for(
int i=0;i25;i++) GiveItemFromFile("tinderbox_"+i"tinderbox.ent");

 
AddEntityCollideCallback("Player""12_girl_scream""GirlScream"true1);
 
AddEntityCollideCallback("Player""message1""Message1"true1);
 
AddEntityCollideCallback("Player""message2""Message2"true1);


 }

void GirlScream(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("12_girl_scream""12_girl_scream.snt""GirlScream01"1.0ftrue);
}


 
void Message1(string &in asChildstring &in asParentint alState)
 {
 
SetMessage("Messages""Wiadomosc1"10); 
 }

 
void Message2(string &in asChildstring &in asParentint alState)
 {
 
SetMessage("Messages""Wiadomosc2"10); 
 }

 
void OnEnter()
 {
 
PlayMusic("07_amb"true1.0f4.0f1true);

 } 

Quote:That should do the trick, IF you intended to do it like i do now though.
IF not, we are here to help you out.
---
Here are some things you miswrote;
You were having some {}
Where they should NOT be there.
And:
{// Wrong
AddEntityCollideCallback("Player", "12_girl_scream", "GirlScream", true, 1); //put this in OnSTART
AddEntityCollideCallback("Player", "message1", "Message1", true, 1); //put this in OnSTART
AddEntityCollideCallback("Player", "message2", "Message2", true, 1); //put this in OnSTART
}//Wrong
PlaySoundAtArea("12_girl_scream", "12_girl_scream.snt", "GirlScream01", 0, false); <<<- Use PlaySoundAtEntity in stead.
}
IF you are making a function\script, try with void
(This post was last modified: 01-15-2015, 02:29 PM by DnALANGE.)
01-15-2015, 02:18 PM
Find


Messages In This Thread
Error with scripts - by MaksoPL - 01-15-2015, 01:53 PM
RE: Error with scripts - by DnALANGE - 01-15-2015, 02:18 PM
RE: Error with scripts - by PutraenusAlivius - 01-16-2015, 02:58 PM
RE: Error with scripts - by DnALANGE - 01-16-2015, 03:06 PM



Users browsing this thread: 1 Guest(s)