04-30-2011, 12:48 PM
Pages: 1 2
04-30-2011, 12:56 PM
Collide with area:
Pick up item:
Code:
OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);
}
void Function01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
}
Pick up item:
Code:
OnStart()
{
SetPlayerInteractCallback("Item", "Function01", true);
}
void Function01(string &in asEntity)
{
SetEntityActive("Monster", true);
}
04-30-2011, 01:00 PM
Thank-you I'll try it out now
Could you please tell me how to make monster follow nodes?
Could you please tell me how to make monster follow nodes?
05-01-2011, 01:42 AM
(04-30-2011, 12:56 PM)Kyle Wrote: [ -> ]Collide with area:
Code:OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);
}
void Function01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
}
Pick up item:
Code:OnStart()
{
SetPlayerInteractCallback("Item", "Function01", true);
}
void Function01(string &in asEntity)
{
SetEntityActive("Monster", true);
}
I do have a question though. I tried using the code you're telling him to use, but it isn't working with me.
05-01-2011, 01:50 AM
(05-01-2011, 01:42 AM)Karai16 Wrote: [ -> ]I do have a question though. I tried using the code you're telling him to use, but it isn't working with me.
Did you plug it all in?
If you used the first script, does the script area match the one you are using for you custom story? Did you replace "Monster" with the name of the monster in you custom story? If yes to both, is the monster in your custom story set to unactive?
If you used the second script, does "Item" have the same name as the name of the item you are using in your custom story? Did you replace "Monster" with the name of the monster in you custom story? If yes to both, is the monster in your custom story set to unactive?
05-01-2011, 12:09 PM
(05-01-2011, 01:50 AM)Kyle Wrote: [ -> ](05-01-2011, 01:42 AM)Karai16 Wrote: [ -> ]I do have a question though. I tried using the code you're telling him to use, but it isn't working with me.
Did you plug it all in?
If you used the first script, does the script area match the one you are using for you custom story? Did you replace "Monster" with the name of the monster in you custom story? If yes to both, is the monster in your custom story set to unactive?
If you used the second script, does "Item" have the same name as the name of the item you are using in your custom story? Did you replace "Monster" with the name of the monster in you custom story? If yes to both, is the monster in your custom story set to unactive?
yes I did... you see this is my code, if you see anything wrong with it please tell me:
Code:
void OnStart()
{
AddUseItemCallback("", "RoomKey", "RoomDoor", "UsedKeyOnDoor", true);
SetPlayerInteractCallback("RoomKey", "Activatebob", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("RoomDoor", false, true);
PlaySoundAtEntity("", "unlock_door", "RoomDoor", 0, false);
RemoveItem("RoomKey");
}
void Activatebob(string &in asEntity)
{
setEntityActive("Bob", true);
}
05-01-2011, 03:14 PM
Yep, i have same problem:
void OnStart()
{
SetPlayerLampOil(0);
//if(ScriptDebugOn())
//{
// GiveItemFromFile("lantern", "lantern.ent");
// for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
// SetPlayerLampOil(0);
//}
SetMessage("Journal", "start", 8.0f);;
SetEntityConnectionStateChangeCallback("lever_nice01_1", "StateChangeLever");
SetPlayerInteractCallback("Item", "Officekey", true);
AddUseItemCallback("", "crowbar_1", "prison_section_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("Player", "Brute_1", "Brute1", true, 1);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
AddEntityCollideCallback("Player", "shake_1", "Earthquake", true, 1);
AddEntityCollideCallback("Player", "AreaKillLights", "KillLights", true, 1);
AddEntityCollideCallback("Player", "AreaKillLights2", "KillLights2", true, 1);
SetEntityPlayerInteractCallback("lantern_1", "Stuff", true);
}
void Officekey(string &in asEntity)
{
SetEntityActive("Brute2", true);
}
Says multiple errors!!
void OnStart()
{
SetPlayerLampOil(0);
//if(ScriptDebugOn())
//{
// GiveItemFromFile("lantern", "lantern.ent");
// for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
// SetPlayerLampOil(0);
//}
SetMessage("Journal", "start", 8.0f);;
SetEntityConnectionStateChangeCallback("lever_nice01_1", "StateChangeLever");
SetPlayerInteractCallback("Item", "Officekey", true);
AddUseItemCallback("", "crowbar_1", "prison_section_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("Player", "Brute_1", "Brute1", true, 1);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
AddEntityCollideCallback("Player", "shake_1", "Earthquake", true, 1);
AddEntityCollideCallback("Player", "AreaKillLights", "KillLights", true, 1);
AddEntityCollideCallback("Player", "AreaKillLights2", "KillLights2", true, 1);
SetEntityPlayerInteractCallback("lantern_1", "Stuff", true);
}
void Officekey(string &in asEntity)
{
SetEntityActive("Brute2", true);
}
Says multiple errors!!
05-01-2011, 03:16 PM
It might take a while, and I kind of messed up there. I can fix that. Here, try this:
Code:
void OnStart()
{
SetPlayerLampOil(0);
if (ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
SetPlayerLampOil(100);
}
SetMessage("Journal", "start", 8.0f);
SetEntityConnectionStateChangeCallback("lever_nice01_1", "StateChangeLever");
SetPlayerInteractCallback("Item", "Officekey", true);
AddUseItemCallback("", "crowbar_1", "prison_section_1", "UserCrowbarOnDoor", true);
SetPlayerInteractCallback("Item", "Officekey", true);
AddEntityCollideCallback("Player", "Brute_1", "Brute1", true, 1);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
AddEntityCollideCallback("Player", "shake_1", "Earthquake", true, 1);
AddEntityCollideCallback("Player", "AreaKillLights", "KillLights", true, 1);
AddEntityCollideCallback("Player", "AreaKillLights2", "KillLights2", true, 1);
SetEntityPlayerInteractCallback("lantern_1", "stuff", true);
}
void Officekey(string &in asEntity)
{
SetEntityActive("Brute2", true);
}
05-01-2011, 03:20 PM
(05-01-2011, 03:16 PM)Kyle Wrote: [ -> ]It might take a while, and I kind of messed up there. I can fix that. Here, try this:
[code]
void OnStart()
{
if (ScriptDebugOn())
{
}
What? I remove these two marks but it doesnt work!
05-01-2011, 03:29 PM
(05-01-2011, 03:20 PM)HumiliatioN Wrote: [ -> ](05-01-2011, 03:16 PM)Kyle Wrote: [ -> ]It might take a while, and I kind of messed up there. I can fix that. Here, try this:
[code]
void OnStart()
{
if (ScriptDebugOn())
{
}
What? I remove these two marks but it doesnt work!
Sorry, the thing was that I didn't mean to press the post button and so it posted that little amount.
Pages: 1 2