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


Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Paper Blow [solved]
clock123 Offline
Member

Posts: 76
Threads: 18
Joined: Jul 2011
Reputation: 0
#1
Paper Blow [solved]

When i get close to an area, I want a wind to blow off the papers from the desk, how I do that?
(This post was last modified: 07-29-2011, 10:14 PM by clock123.)
07-29-2011, 07:48 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#2
RE: Paper Blow

void OnStart()
{
    AddEntityCollideCallback("Player", "AreaActivate", "CollideAreaActivate", true, 1);
}

void CollideAreaActivate(string &in asParent, string &in asChild, int alState)
{
        AddTimer("blowpaper", 1.0f, "TimerPaperBlow"); //Without a timer the sound wouldn't fit.
        PlaySoundAtEntity("windsound", "scare_wind_reverse", "AreaBlow", 1.0f, false);
}

void TimerPaperBlow(string &in asTimer)
{
        CreateParticleSystemAtEntity("paper", "ps_paper_blow.ps", "AreaBlow", false);
}


Attached Files
.jpg   amnesiatut.jpg (Size: 218.73 KB / Downloads: 190)

[Image: 18694.png]
07-29-2011, 08:20 PM
Find
clock123 Offline
Member

Posts: 76
Threads: 18
Joined: Jul 2011
Reputation: 0
#3
RE: Paper Blow

Wait.... What I have to write in what?, Here's the things I did in pictures, and the script.:
The pictures : http://imageshack.us/g/11/bhhghg.png/
The script:
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "AreaActivate", "CollideAreaActivate", true, 1);
SetEntityConnectionStateChangeCallback("Lever1", "func_shelf");
AddUseItemCallback("", "Key1", "Door1", "KeyOnDoor", true);
AddUseItemCallback("", "Key2", "Door2", "KeyOnDoor2", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("Shelf1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door1", false, true);
PlaySoundAtEntity("", "unlock_door", "Door1", 0, false);
RemoveItem("Key1");
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door2", false, true);
PlaySoundAtEntity("", "unlock_door", "door2", 0, false);
RemoveItem("Key2");
}

void CollideAreaActivate(string &in asParent, string &in asChild, int alState)
{
AddTimer("blowpaper", 1.0f, "TimerPaperBlow"); //Without a timer the sound wouldn't fit.
PlaySoundAtEntity("windsound", "scare_wind_reverse", "AreaBlow", 1.0f, false);
}

void TimerPaperBlow(string &in asTimer)
{
CreateParticleSystemAtEntity("paper", "ps_paper_blow.ps", "AreaBlow", false);
}

I know I need to put the script in the hps file, but I just dont know what to do with what, I mean, what name's to input in what, etc'. if someone can just help me about this I will thank him Smile
07-29-2011, 09:01 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#4
RE: Paper Blow

The area on the floor should be called "AreaBlow".
Wait I'll put comments to describe into the script.^^

void OnStart()
{
    AddEntityCollideCallback("Player", "AreaActivate", "CollideAreaActivate", true, 1); //Player = who has to be in the area, can also be an object or enemy. AreaActivate(has to be the same name as in leveleditor) is which area Player has to be in to activate the script called CollideAreaActivate.
}

void CollideAreaActivate(string &in asParent, string &in asChild, int alState)
{
        AddTimer("blowpaper", 1.0f, "TimerPaperBlow"); //blowpaper is just a random name, you can name it asdf as well. 1.0f is the amount of time till TimerPaperBlow gets activated.
        PlaySoundAtEntity("windsound", "scare_wind_reverse", "AreaBlow", 1.0f, false); //Windsound is also a random name, scare_wind_reverse is the name of the soundfile, AreaBlow is where the sound is played, 1.0f is the fade time and false declares that it wont repeat.
}

void TimerPaperBlow(string &in asTimer)
{
        CreateParticleSystemAtEntity("paper", "ps_paper_blow.ps", "AreaBlow", false); //paper = random name, ps_paper_blow.ps is the name of the particlesystem, AreaBlow is where it gets created.
}

[Image: 18694.png]
(This post was last modified: 07-29-2011, 09:42 PM by Ongka.)
07-29-2011, 09:08 PM
Find
clock123 Offline
Member

Posts: 76
Threads: 18
Joined: Jul 2011
Reputation: 0
#5
RE: Paper Blow

It wont work for me, Perphaps I named something wrong?, It can't be, everything is the same name but I changed what you told me to, the script at the floor to "Areablow"
You maybe know why it wont work?
07-29-2011, 09:47 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#6
RE: Paper Blow

Scripts are case-sensitive.
If you write Areablow it wont work, try AreaBlow.
I've attached you the working map + script.


Attached Files
.rar   paperblow.rar (Size: 2.29 KB / Downloads: 144)

[Image: 18694.png]
(This post was last modified: 07-29-2011, 10:07 PM by Ongka.)
07-29-2011, 09:48 PM
Find
clock123 Offline
Member

Posts: 76
Threads: 18
Joined: Jul 2011
Reputation: 0
#7
RE: Paper Blow

Yeap works, thanks alot!! Big GrinDD
07-29-2011, 10:14 PM
Find




Users browsing this thread: 3 Guest(s)