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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking the position of entities
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#10
RE: Checking the position of entities

Information:
name the stickyArea 1: Skull01
name your grabbable skull 1: Skull01_dyn
name your static skull 1: Skull01_stat
name the stickyArea 2: Skull02
name your grabbable skull 2: Skull02_dyn
name your static skull 2: Skull02_stat

And so on. In the entity tab for the skull on the ground you have to set "static_physics" = true. Place each sticky area at the position of these static skulls. The static skulls should also be set to "Active" = false in the general tab.

SkullMessage = The Skull fits perfectly in place. (Or something else of your liking)

Script:
Spoiler below!

void AttachSkull(string &in asArea, string &in asBody)
{
AddTimer(asArea, 0.5f, "SkullTimer");
AddLocalVarInt("SkullsNumber", 1);

}

void SkullTimer(string &in asTimer)
{
SetEntityActive(asTimer+"_dyn", false);
SetEntityActive(asTimer+"_stat", true);
PlaySoundAtEntity("", "Soundfile.ogg", asTimer+"_stat", 0.1f, false);
SetMessage("Area", "SkullMessage", 0);
}


Editing the sticky area:

.jpg   GuideToSkull.JPG (Size: 15.89 KB / Downloads: 155)

You change the the attachable to "Skull02_dyn" for stickyArea 2 named Skull02 - and so on. Haha, this is a mess.

Best of luck, if any troubles come up i'll help you. *Whipes of sweaty forehead*
Noticed I had forgotten the finale..

CreateSuccessMessage = Set it to whatever you like
You should have created the item and set it to "Active" = false in the editor already (named it "ItemCreated" - change it to your liking.)

Script:
Spoiler below!

void OnStart()
{
AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);
}

void MyFunc(string &in asItem, string &in asEntity)
{
if(GetLocalVarInt("SkullNumber")==4)
{
SetMessage("Area", "CreateSuccessMessage", 0);
SetEntityActive("ItemCreated", true);
//--- here you can add particle systems and sounds as well, during the creation of your item ---
return;
}
}


[Image: mZiYnxe.png]


(This post was last modified: 05-06-2011, 12:49 AM by Acies.)
05-05-2011, 09:59 PM
Find


Messages In This Thread
RE: Checking the position of entities - by Acies - 05-05-2011, 08:46 PM
RE: Checking the position of entities - by Acies - 05-05-2011, 08:58 PM
RE: Checking the position of entities - by Apjjm - 05-05-2011, 09:18 PM
RE: Checking the position of entities - by Acies - 05-05-2011, 09:28 PM
RE: Checking the position of entities - by Acies - 05-05-2011, 09:59 PM
RE: Checking the position of entities - by Acies - 05-06-2011, 12:31 AM
RE: Checking the position of entities - by Apjjm - 05-06-2011, 02:33 AM
RE: Checking the position of entities - by Acies - 05-06-2011, 03:10 AM



Users browsing this thread: 1 Guest(s)