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 Help...
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#11
RE: Help...

I mean just delete it

In Ruins [WIP]
04-04-2013, 07:43 PM
Find
Yare Offline
Junior Member

Posts: 22
Threads: 2
Joined: Mar 2013
Reputation: 0
#12
RE: Help...

Every action you include within OnStart() or OnEnter() comes without "void". It means you need to write just:
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);

instead of:
void AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor"
04-04-2013, 07:44 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#13
RE: Help...

////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}


UsedKeyOnDoor(string&in asItem, string &in as Entity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}



Getting insane haha, this is right?

now i get this error.. :
Expected Identifier
(This post was last modified: 04-04-2013, 08:00 PM by Darkboot.)
04-04-2013, 07:59 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#14
RE: Help...

Well, you took out the right void, but you also took out another void that you needed. Add void in front of this line:
UsedKeyOnDoor(string&in asItem, string &in as Entity)
so it looks like this:
void UsedKeyOnDoor(string &in asItem, string &in asEntity)

Edit: fixed code. It's not very easy to write code on my phone :p

In Ruins [WIP]
(This post was last modified: 04-04-2013, 09:36 PM by NaxEla.)
04-04-2013, 08:47 PM
Find
Yare Offline
Junior Member

Posts: 22
Threads: 2
Joined: Mar 2013
Reputation: 0
#15
RE: Help...

Now you unnecessarly removed "void" from the place it should be Tongue

I will try to explain:
void OnStart()
{
Everything inside this goes without "void".
}

Outside "OnStart" every function name must be preceded with "void"

So your script should be like this:

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}


void UsedKeyOnDoor(string&in asItem, string &in as Entity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
04-04-2013, 08:48 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#16
RE: Help...

Im doing something wrong now? O.o

////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}



void UsedKeyOnDoor(string&in asItem, string &in as Entity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Question: Why cant i put i in in the same as the other? in this {}
so it looks like this.

////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
UsedKeyOnDoor(string&in asItem, string &in as Entity)
}


{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}

PS: I Asume that somethings wrong cause i cant open the custom story yet, i still get

Expected '(' or ','
(This post was last modified: 04-04-2013, 09:09 PM by Darkboot.)
04-04-2013, 09:06 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#17
RE: Help...

UsedKeyOnDoor(string&in asItem, string &in as Entity)

to:

UsedKeyOnDoor(string&in asItem, string &in as Entity);
04-04-2013, 09:30 PM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#18
RE: Help...

(04-04-2013, 07:37 PM)Darkboot Wrote:
(04-04-2013, 07:22 PM)NaxEla Wrote: You need to take out the void before AddUseItemCallback.

Edit: you also need to write
(string &in asItem, string &in asEntity)
after void UsedKeyOnDoor.

How do you mean with " take out the void"?

AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}


void UsedKeyOnDoor
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}

The error appears because of "void" before adduseitemcallback. It should work now Big Grin
04-04-2013, 09:30 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#19
RE: Help...

////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string&in asItem, string &in as Entity);

{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
------------------------------------------------------------------------------------------------------------------------------------
My script right now.

If i deleted the " Void " of "adduseitemcallback" i got another error and the others 2 in the beginning of this page said that the " void " should fix the prolem when i had it.

ERROR:
unexpected token '{'
(This post was last modified: 04-05-2013, 11:53 AM by Darkboot.)
04-05-2013, 10:44 AM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#20
RE: Help...

(04-05-2013, 10:44 AM)Darkboot Wrote: ////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string&in asItem, string &in as Entity);

{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
------------------------------------------------------------------------------------------------------------------------------------
My script right now.

If i deleted the " Void " of "adduseitemcallback" i got another error and the others 2 in the beginning of this page said that the " void " should fix the prolem when i had it.

ERROR:
unexpected token '{'

You don't need an ';' after UsedKeyOnDoor(string&in asItem, string &in as Entity). That's only for inside the functions
04-05-2013, 12:18 PM
Find




Users browsing this thread: 1 Guest(s)