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 Something wrong ?
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#1
Something wrong ?

wtf

i wan't to make a when player pick up key monster activate

.hps

SetEntityPlayerInteractCallback("Tomby1", "ActivateMonster", true);

and

void ActivateMonster(string &in asItem, string &in asEntity)
{
SetEntityActive("Alexander1", "true");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_3", 0, "idle");
}



Full .hps


void OnStart()

{
AddUseItemCallback("", "Key123", "Door123", "UseKeyOnDoor", true);
AddUseItemCallback("", "Study123", "Doors122", "UseKeyOnDoor2", true);
AddEntityCollideCallback("Player", "SoundArea", "crossarea", true, 1);
SetEntityPlayerInteractCallback("Tomby1", "ActivateMonster", true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door123", false, true);
PlaySoundAtEntity("", "unlock_door", "Door123", 0, false);
RemoveItem("Key123");
}

void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Doors122", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Doors122", 0, false);
RemoveItem("Study123");
}

void ActivateMonster(string &in asItem, string &in asEntity)
{
SetEntityActive("Alexander1", "true");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("Alexander1", "PathNodeArea_3", 0, "idle");
}





What is problem ?????? it says something like missing void OnLeave() can set .hps how should be please?

And yeah Alexander enemy :S Tongue

(This post was last modified: 03-20-2014, 10:36 AM by Straxedix.)
03-20-2014, 10:35 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Something wrong ?

The parameters for SetEntityPlayerInteractCallback is (string &in asEntity), not (string &in asItem,string &in asEntity) as you've put.

03-20-2014, 11:53 AM
Find
davide32 Offline
Junior Member

Posts: 27
Threads: 6
Joined: Nov 2013
Reputation: 0
#3
RE: Something wrong ?

You putted a bool on lineSad1-1) on your file hps
03-20-2014, 02:06 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#4
RE: Something wrong ?

(03-20-2014, 11:53 AM)Mudbill Wrote: The parameters for SetEntityPlayerInteractCallback is (string &in asEntity), not (string &in asItem,string &in asEntity) as you've put.

Still not working

03-21-2014, 11:31 AM
Find
davide32 Offline
Junior Member

Posts: 27
Threads: 6
Joined: Nov 2013
Reputation: 0
#5
RE: Something wrong ?

Try this:
void OnStart()
{
SetEntityPlayerInterractCallback("Tomby_1", "activemonster");
}
void activemonster(string &in asEntity)
{
SetEntityActive(asEntity, true);
}
03-21-2014, 12:08 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Something wrong ?

I don't think you can use an interact callback for picking up the item because it happens before. If you go to the entity tab of the key in the editor, put a name in the EntityCallback box (hovering over it will mention OnPickup). Then change that callback in the script from being an interaction callback to just a normal callback. I think the parameters are the same as what I posted before.

03-21-2014, 12:14 PM
Find
davide32 Offline
Junior Member

Posts: 27
Threads: 6
Joined: Nov 2013
Reputation: 0
#7
RE: Something wrong ?

Or SetEntityCallbackFunc("tomb_1', "func");
void func(string &in asEntity, string &in type)
03-21-2014, 01:11 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: Something wrong ?

^ Yes, that would do the same. The parameters are indeed those: (string &in asEntity, string &in type)

(This post was last modified: 03-21-2014, 02:04 PM by Mudbill.)
03-21-2014, 02:04 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#9
RE: Something wrong ?

So it looks like next:
void OnStart()
SetEntityCallbackFunc("Tomby_1', "activemonster");

void activemonster(string &in asEntity)
{
SetEntityActive(asEntity, true);
}

03-21-2014, 09:06 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#10
RE: Something wrong ?

Dunno why you have SetEntityActive in there when you said you wanted to activate a monster. Either way you still didn't change the parameters to what I said.

03-21-2014, 09:10 PM
Find




Users browsing this thread: 2 Guest(s)