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 Problems
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#21
RE: Script Problems

(03-06-2013, 06:24 PM)darksky Wrote: you have to put SetEntityCallbackFunc in a function

like
void OnStart(){
   SetEntityCallbackFunc("GuestRoomKey", "jump");
}

void OnStart (){
SetEntityCallbackFunc("GuestRoomKey", "jump");
}

{
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "21_screams.snt", "corpse01", 0, false);
}

void OnEnter()
{

}

void OnLeave()
{

}


This is the whole file. I just cant get it to work. I've searched for the error on the page but I cant find it. I dont get what the problem is
03-06-2013, 07:40 PM
Find Reply
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#22
RE: Script Problems

addUseItemcallback is not within a function ,too
try this

void OnStart (){
   SetEntityCallbackFunc("GuestRoomKey", "jump");
   AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "21_screams.snt", "corpse01", 0, false);
}

void OnEnter()
{

}

void OnLeave()
{

}

you should invest more time in your programming in general.
you could start by reading this guide
http://wiki.frictionalgames.com/hpl2/amn..._and_guide
(This post was last modified: 03-06-2013, 08:42 PM by darksky.)
03-06-2013, 08:41 PM
Find Reply
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#23
RE: Script Problems

(03-06-2013, 08:41 PM)darksky Wrote: addUseItemcallback is not within a function ,too
try this

void OnStart (){
   SetEntityCallbackFunc("GuestRoomKey", "jump");
   AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "21_screams.snt", "corpse01", 0, false);
}

void OnEnter()
{

}

void OnLeave()
{

}

you should invest more time in your programming in general.
you could start by reading this guide
http://wiki.frictionalgames.com/hpl2/amn..._and_guide

thanks!

I feel like an idiot now but how do I make him disappear after he appeared?
03-07-2013, 06:00 PM
Find Reply
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#24
RE: Script Problems

(03-07-2013, 06:00 PM)Coolfromdah00d Wrote:
(03-06-2013, 08:41 PM)darksky Wrote: addUseItemcallback is not within a function ,too
try this

void OnStart (){
   SetEntityCallbackFunc("GuestRoomKey", "jump");
   AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "21_screams.snt", "corpse01", 0, false);
}

void OnEnter()
{

}

void OnLeave()
{

}

you should invest more time in your programming in general.
you could start by reading this guide
http://wiki.frictionalgames.com/hpl2/amn..._and_guide

thanks!

I feel like an idiot now but how do I make him disappear after he appeared?
SetEntityActive("corpse01", true);

but have it be

SetEntityActive("corpse01", false);

03-07-2013, 06:37 PM
Find Reply
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#25
RE: Script Problems

(03-07-2013, 06:37 PM)WIWWM Wrote:
(03-07-2013, 06:00 PM)Coolfromdah00d Wrote:
(03-06-2013, 08:41 PM)darksky Wrote: addUseItemcallback is not within a function ,too
try this

void OnStart (){
   SetEntityCallbackFunc("GuestRoomKey", "jump");
   AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}


void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "21_screams.snt", "corpse01", 0, false);
}

void OnEnter()
{

}

void OnLeave()
{

}

you should invest more time in your programming in general.
you could start by reading this guide
http://wiki.frictionalgames.com/hpl2/amn..._and_guide

thanks!

I feel like an idiot now but how do I make him disappear after he appeared?
SetEntityActive("corpse01", true);

but have it be

SetEntityActive("corpse01", false);

alright
03-07-2013, 06:44 PM
Find Reply
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#26
RE: Script Problems

Not trying to be mean, but i would try to solve problems on your own before coming to the community.
It will help your problem solving skills.

(This post was last modified: 03-07-2013, 06:53 PM by 7heDubz.)
03-07-2013, 06:53 PM
Find Reply
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#27
RE: Script Problems

(03-07-2013, 06:53 PM)WIWWM Wrote: Not trying to be mean, but i would try to solve problems on your own before coming to the community.
It will help your problem solving skills.

So you think that I was like "hm, this doesent work, I know! I'l ask soeone else to do it for me!!!!"

(03-08-2013, 06:11 PM)Coolfromdah00d Wrote:
(03-07-2013, 06:53 PM)WIWWM Wrote: Not trying to be mean, but i would try to solve problems on your own before coming to the community.
It will help your problem solving skills.

So you think that I was like "hm, this doesent work, I know! I'l ask soeone else to do it for me!!!!"

*someone and *I'll
(This post was last modified: 03-08-2013, 06:12 PM by Coolfromdah00d.)
03-08-2013, 06:11 PM
Find Reply
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#28
RE: Script Problems

(03-07-2013, 06:53 PM)WIWWM Wrote: Not trying to be mean, but i would try to solve problems on your own before coming to the community.
It will help your problem solving skills.

He's right. I started working with the HPL2 suite nearly 2 years ago and I never asked for help once - EVERYTHING you need to know can be found out on the Frictional Games Wiki page or the forum and if not there, you can check the original game maps. And if it's something new, just experiment until it works, asking in the forum should be a last resort in my opinion Big Grin
(This post was last modified: 03-08-2013, 06:38 PM by ExpectedIdentifier.)
03-08-2013, 06:37 PM
Find Reply
Coolfromdah00d Offline
Junior Member

Posts: 38
Threads: 5
Joined: Mar 2013
Reputation: 0
#29
RE: Script Problems

(03-08-2013, 06:37 PM)sonataarctica Wrote:
(03-07-2013, 06:53 PM)WIWWM Wrote: Not trying to be mean, but i would try to solve problems on your own before coming to the community.
It will help your problem solving skills.

He's right. I started working with the HPL2 suite nearly 2 years ago and I never asked for help once - EVERYTHING you need to know can be found out on the Frictional Games Wiki page or the forum and if not there, you can check the original game maps. And if it's something new, just experiment until it works, asking in the forum should be a last resort in my opinion Big Grin

I AM only asking on the forum when I really cant figure it out....
03-08-2013, 06:59 PM
Find Reply
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#30
RE: Script Problems

(03-08-2013, 06:59 PM)Coolfromdah00d Wrote:
(03-08-2013, 06:37 PM)sonataarctica Wrote:
(03-07-2013, 06:53 PM)WIWWM Wrote: Not trying to be mean, but i would try to solve problems on your own before coming to the community.
It will help your problem solving skills.

He's right. I started working with the HPL2 suite nearly 2 years ago and I never asked for help once - EVERYTHING you need to know can be found out on the Frictional Games Wiki page or the forum and if not there, you can check the original game maps. And if it's something new, just experiment until it works, asking in the forum should be a last resort in my opinion Big Grin

I AM only asking on the forum when I really cant figure it out....

You're asking about very basic things, you need to learn the basics of scripting before you jump straight into making a custom story or you're going to keep running into problems.
03-08-2013, 07:09 PM
Find Reply




Users browsing this thread: 1 Guest(s)