Frictional Games Forum (read-only)

Full Version: Something wrong ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
The parameters for SetEntityPlayerInteractCallback is (string &in asEntity), not (string &in asItem,string &in asEntity) as you've put.
You putted a bool on lineSad1-1) on your file hps
(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
Try this:
void OnStart()
{
SetEntityPlayerInterractCallback("Tomby_1", "activemonster");
}
void activemonster(string &in asEntity)
{
SetEntityActive(asEntity, true);
}
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.
Or SetEntityCallbackFunc("tomb_1', "func");
void func(string &in asEntity, string &in type)
^ Yes, that would do the same. The parameters are indeed those: (string &in asEntity, string &in type)
So it looks like next:
void OnStart()
SetEntityCallbackFunc("Tomby_1', "activemonster");

void activemonster(string &in asEntity)
{
SetEntityActive(asEntity, true);
}
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.
Pages: 1 2