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
Solved Script doesnt work.
Author Message
kartanonperuna Offline
Senior Member

Posts: 741
Joined: Oct 2011
Reputation: 8
Post: #1
Script doesnt work.
It says:

A funciton with the same name and parameters already exist(hps) and "Downstairskey"is not declared.




void OnStart()
{
AddEntityCollideCallback("crowbar_joint_2", "crowcollide", "crowopen_func", true, 1);
AddUseItemCallback("", "crowbar_1", "prison_locked", "activatecrowdoor", true);
}



void crowopen_func(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("prison_locked", false, true);
CreateParticleSystemAtEntity("", "ps_break_wood.ps", "area1", false);
SetEntityActive("crowbar_joint_2", false);
GiveSanityBoost();
PlaySoundAtEntity("", "break_wood.snt", "area1", 0, false);
SetSwingDoorClosed("prison_locked", false, true);
SetSwingDoorDisableAutoClose("prison_locked", true);
AddPropImpulse("prison_locked", 0, 0, -3, "world");
}

void activatecrowdoor(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_2", true);
RemoveItem("crowbar_1");
}

void OnStart()
{
AddUseItemCallback("", "Downstairsdoor", "cellar_wood01_slow", "KeyOnDoor", true);
}


void KeyOnDoor(string &in , string &in door)
{
SetSwingDoorLocked("cellar_wood01_slow", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_slow", 0, false);
RemoveItem(Downstairskey);
}


After I added they key opening door script.Whats wrong?
(This post was last modified: 01-07-2012 06:32 AM by kartanonperuna.)
01-07-2012 04:43 AM
Visit this user's website Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,319
Joined: Apr 2011
Reputation: 57
Post: #2
RE: Script doesnt work.
You have 2 void OnStart()'s

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("crowbar_joint_2""crowcollide""crowopen_func"true1);
AddUseItemCallback("""crowbar_1""prison_locked""activatecrowdoor"true);
AddUseItemCallback("""Downstairsdoor""cellar_wood01_slow""KeyOnDoor"true); 
}



void crowopen_func(string &in asParentstring &in asChildint alState)
{
SetSwingDoorLocked("prison_locked"falsetrue);
CreateParticleSystemAtEntity("""ps_break_wood.ps""area1"false);
SetEntityActive("crowbar_joint_2"false);
GiveSanityBoost();
PlaySoundAtEntity("""break_wood.snt""area1"0false);
SetSwingDoorClosed("prison_locked"falsetrue);
SetSwingDoorDisableAutoClose("prison_locked"true);
AddPropImpulse("prison_locked"00, -3"world");
}

void activatecrowdoor(string &in asItemstring &in asEntity)
{
SetEntityActive("crowbar_joint_2"true);
RemoveItem("crowbar_1");
}

void KeyOnDoor(string &in string &in door)
{
SetSwingDoorLocked("cellar_wood01_slow"falsetrue);
PlaySoundAtEntity("""unlock_door""cellar_wood01_slow"0false);
RemoveItem("Downstairskey");



The reason Downstairskey didn't work is because you didn't have "" around it.

(This post was last modified: 01-07-2012 04:58 AM by flamez3.)
01-07-2012 04:57 AM
Find all posts by this user Quote this message in a reply
kartanonperuna Offline
Senior Member

Posts: 741
Joined: Oct 2011
Reputation: 8
Post: #3
RE: Script doesnt work.
Okay it works.But what about the other issue?
01-07-2012 05:04 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kartanonperuna Offline
Senior Member

Posts: 741
Joined: Oct 2011
Reputation: 8
Post: #4
RE: Script doesnt work.
Wait it didnt work.
01-07-2012 06:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,319
Joined: Apr 2011
Reputation: 57
Post: #5
RE: Script doesnt work.
What didn't work, what did the error say?

01-07-2012 06:24 AM
Find all posts by this user Quote this message in a reply
kartanonperuna Offline
Senior Member

Posts: 741
Joined: Oct 2011
Reputation: 8
Post: #6
RE: Script doesnt work.
No object to use the item on.it doesnt open
01-07-2012 06:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,319
Joined: Apr 2011
Reputation: 57
Post: #7
RE: Script doesnt work.
Did you name everything correctly. Is it .hps, not .map?

01-07-2012 06:28 AM
Find all posts by this user Quote this message in a reply
kartanonperuna Offline
Senior Member

Posts: 741
Joined: Oct 2011
Reputation: 8
Post: #8
RE: Script doesnt work.
Khyrpa solved it.
01-07-2012 06:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,319
Joined: Apr 2011
Reputation: 57
Post: #9
RE: Script doesnt work.
You mind telling me what was wrong?

01-07-2012 06:56 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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