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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Explosion Script
Author Message
GoranGaming Offline
Member

Posts: 174
Joined: Feb 2012
Reputation: 6
Post: #1
Explosion Script
I am creating a explosion script for my map. But it doesn't seem to work.



void ExplodeFunc(string &in asEntity)
{
AddDebugMessage("Explosive Timer Started", false);
AddTimer("ExplodeT", 6, "ExplodeTFunc");
}

void ExplodeTFunc(string &in asTimer)
{
AddDebugMessage("Exploded", false);
SetEntityActive("cave_in_1", false);
SetEntityActive("cave_in_destroyed_1", true);
StartScreenShake(0.08, 2.5f, 0, 1.0f);

FadeImageTrailTo(0.5, 1);

FadeLightTo("BoomLight", 1, 1, 1, 1, 8, 0.1f);
FadeLightTo("DangerLight", 0, 0, 0, 0, 0, 0.5f);
}

void PlaceExFunc(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("placejar", "puzzle_place_jar.snt", "ExSta", 0, false);
RemoveItem(asItem);
AddDebugMessage("Explosives Placed", false);
SetEntityActive("ExSta", true);
SetEntityActive("ExPress", true);

//SetEntityActive("cave_in_1", false);
//SetEntityActive("cave_in_destroyed_1", true);
}
void OnStart()

{
//EDITOR
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i< 10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");

PlayMusic("04_amb.ogg", true, 10, 2, 1, true);

AddUseItemCallback("ExEnt", "ExEnt", "PlaceEx", "PlaceExFunc", true);
SetEntityPlayerInteractCallback("ExPress", "ExplodeFunc", true);
}



void OnEnter()

{



}


void OnLeave()

{


StopMusic(1, 1);

}

Can you tell me what is wrong with it. Also, here is the map:

http://www.mediafire.com/?vgv6s9wq7klwosi


/ GoranGaming

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
03-01-2012 04:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #2
RE: Explosion Script
Does it give you any errors?

03-01-2012 04:24 PM
Find all posts by this user Quote this message in a reply
GoranGaming Offline
Member

Posts: 174
Joined: Feb 2012
Reputation: 6
Post: #3
RE: Explosion Script
No it does not

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
03-01-2012 04:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
GoranGaming Offline
Member

Posts: 174
Joined: Feb 2012
Reputation: 6
Post: #4
RE: Explosion Script
Anyone!?

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
03-01-2012 06:18 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,236
Joined: Jul 2011
Reputation: 216
Post: #5
RE: Explosion Script
Be specific about what doesn't work.

Tutorials: From Noob to Pro
03-01-2012 07:39 PM
Visit this user's website Find all posts by this user Quote this message in a reply
GoranGaming Offline
Member

Posts: 174
Joined: Feb 2012
Reputation: 6
Post: #6
RE: Explosion Script
Ok, it works now. I could place the explosives, but it wouldn't explode. It works now.

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
03-01-2012 08:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




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