Wank
Junior Member
Posts: 28
Threads: 11
Joined: May 2013
Reputation:
0
|
"Look" script not working
I get errors. Here it is-
void OnStart()
{
AddEntityCollideCallback("Player", "scr_spawnEnemy1", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "EventCollide", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "LookScript", "StartPlayerLookAt", true, 1);
AddUseItemCallback("", "key_study_one", "mansion_3", "UseKeyOnDoor", true);
AddUseItemCallback("", "key_tomb", "level_wood", "UseKeyOnDoor2", true);
PreloadSound("break_glass_bottle.snt");
PreloadSound("break_glass_bottle.snt");
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy1", true);
SetEntityActive("StatueOne", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_6", 0, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem(asItem);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy2", true);
SetEntityActive("Enemy3", true);
SetEntityActive("deformed_man", true);
PlaySoundAtEntity("", "break_wood_metal.snt", "spawnEnemy2", 0.0, false);
}
void UseKeyOnDoor2(string &in asItem, string &in asEntity)
}
SetSwingDoorLocked("level_wood", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood", 0, false);
RemoveItem(asItem);
}
void StartPlayerLookAt(string& "Look3", 3.0f, 3.0f, "");
{
void OnLeave()
{
}
|
|
05-26-2013, 03:41 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: "Look" script not working
void OnStart()
{
AddEntityCollideCallback("Player", "scr_spawnEnemy1", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "EventCollide", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "LookScript", "StartPlayerLookAt", true, 1);
AddUseItemCallback("", "key_study_one", "mansion_3", "UseKeyOnDoor", true);
AddUseItemCallback("", "key_tomb", "level_wood", "UseKeyOnDoor2", true);
PreloadSound("break_glass_bottle.snt");
PreloadSound("break_glass_bottle.snt");
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy1", true);
SetEntityActive("StatueOne", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_6", 0, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem(asItem);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy2", true);
SetEntityActive("Enemy3", true);
SetEntityActive("deformed_man", true);
PlaySoundAtEntity("", "break_wood_metal.snt", "spawnEnemy2", 0.0, false);
}
void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_wood", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood", 0, false);
RemoveItem(asItem);
}
void StartPlayerLookAt(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt(string& "Look3", 3.0f, 3.0f, "");
}
void OnLeave()
{
}
Fixed.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
05-26-2013, 04:16 PM |
|
Wank
Junior Member
Posts: 28
Threads: 11
Joined: May 2013
Reputation:
0
|
RE: "Look" script not working
(05-26-2013, 04:16 PM)JustAnotherPlayer Wrote: void OnStart()
{
AddEntityCollideCallback("Player", "scr_spawnEnemy1", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "EventCollide", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "LookScript", "StartPlayerLookAt", true, 1);
AddUseItemCallback("", "key_study_one", "mansion_3", "UseKeyOnDoor", true);
AddUseItemCallback("", "key_tomb", "level_wood", "UseKeyOnDoor2", true);
PreloadSound("break_glass_bottle.snt");
PreloadSound("break_glass_bottle.snt");
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy1", true);
SetEntityActive("StatueOne", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_6", 0, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem(asItem);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy2", true);
SetEntityActive("Enemy3", true);
SetEntityActive("deformed_man", true);
PlaySoundAtEntity("", "break_wood_metal.snt", "spawnEnemy2", 0.0, false);
}
void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_wood", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood", 0, false);
RemoveItem(asItem);
}
void StartPlayerLookAt(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt(string& "Look3", 3.0f, 3.0f, "");
}
void OnLeave()
{
}
Fixed.
I get an error that says "(46, 25): ERR :Expected '(' "
|
|
05-26-2013, 04:29 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: "Look" script not working
(05-26-2013, 04:29 PM)Wank Wrote: (05-26-2013, 04:16 PM)JustAnotherPlayer Wrote: void OnStart()
{
AddEntityCollideCallback("Player", "scr_spawnEnemy1", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "EventCollide", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "LookScript", "StartPlayerLookAt", true, 1);
AddUseItemCallback("", "key_study_one", "mansion_3", "UseKeyOnDoor", true);
AddUseItemCallback("", "key_tomb", "level_wood", "UseKeyOnDoor2", true);
PreloadSound("break_glass_bottle.snt");
PreloadSound("break_glass_bottle.snt");
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy1", true);
SetEntityActive("StatueOne", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_6", 0, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem(asItem);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy2", true);
SetEntityActive("Enemy3", true);
SetEntityActive("deformed_man", true);
PlaySoundAtEntity("", "break_wood_metal.snt", "spawnEnemy2", 0.0, false);
}
void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_wood", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood", 0, false);
RemoveItem(asItem);
}
void StartPlayerLookAt(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Look3", 3.0f, 3.0f, "");
}
void OnLeave()
{
}
Fixed.
I get an error that says "(46, 25): ERR :Expected '(' "
Should be fixed.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
05-26-2013, 04:33 PM |
|
7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
RE: "Look" script not working
@ wank
this code here (46, 25) means that 46 lines of code down and 25 characters right there is a problem.
And if the Error (ERR) was that t expected a "(" 46 lines down and 25 characters over, you should be able to fix that on your own
Im not syaing dont post if you cant figure something out but if your gonna script you might as well know how the eorror codes work.
|
|
05-26-2013, 04:41 PM |
|
Wank
Junior Member
Posts: 28
Threads: 11
Joined: May 2013
Reputation:
0
|
RE: "Look" script not working
(05-26-2013, 04:33 PM)JustAnotherPlayer Wrote: (05-26-2013, 04:29 PM)Wank Wrote: (05-26-2013, 04:16 PM)JustAnotherPlayer Wrote: void OnStart()
{
AddEntityCollideCallback("Player", "scr_spawnEnemy1", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "EventCollide", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "LookScript", "StartPlayerLookAt", true, 1);
AddUseItemCallback("", "key_study_one", "mansion_3", "UseKeyOnDoor", true);
AddUseItemCallback("", "key_tomb", "level_wood", "UseKeyOnDoor2", true);
PreloadSound("break_glass_bottle.snt");
PreloadSound("break_glass_bottle.snt");
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy1", true);
SetEntityActive("StatueOne", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_6", 0, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem(asItem);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy2", true);
SetEntityActive("Enemy3", true);
SetEntityActive("deformed_man", true);
PlaySoundAtEntity("", "break_wood_metal.snt", "spawnEnemy2", 0.0, false);
}
void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_wood", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood", 0, false);
RemoveItem(asItem);
}
void StartPlayerLookAt(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Look3", 3.0f, 3.0f, "");
}
void OnLeave()
{
}
Fixed.
I get an error that says "(46, 25): ERR :Expected '(' "
Should be fixed.
How can I make the player stop looking?
(05-26-2013, 04:41 PM)WIWWM Wrote: @ wank
this code here (46, 25) means that 46 lines of code down and 25 characters right there is a problem.
And if the Error (ERR) was that t expected a "(" 46 lines down and 25 characters over, you should be able to fix that on your own
Im not syaing dont post if you cant figure something out but if your gonna script you might as well know how the eorror codes work.
I know how it works, but there was already a ( there. After another time of testing I noticed it was for a different map.
(This post was last modified: 05-26-2013, 05:36 PM by Wank.)
|
|
05-26-2013, 05:02 PM |
|
Traggey
is mildly amused
Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation:
185
|
RE: "Look" script not working
1. Stop posting a billion of threads for the same issue.
2. This is the wrong section of the forums, I'm moving this to development support along with your other threads.
|
|
05-26-2013, 06:12 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: "Look" script not working
void OnStart()
{
AddEntityCollideCallback("Player", "scr_spawnEnemy1", "SpawnEnemy1", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "EventCollide", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "spawnEnemy2", "Sound", true, 1);
AddEntityCollideCallback("Player", "LookScript", "StartPlayerLookAt", true, 1);
AddUseItemCallback("", "key_study_one", "mansion_3", "UseKeyOnDoor", true);
AddUseItemCallback("", "key_tomb", "level_wood", "UseKeyOnDoor2", true);
PreloadSound("break_glass_bottle.snt");
PreloadSound("break_glass_bottle.snt");
}
void SpawnEnemy1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy1", true);
SetEntityActive("StatueOne", true);
AddEnemyPatrolNode("Enemy1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Enemy1", "PathNodeArea_6", 0, "");
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem(asItem);
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy2", true);
SetEntityActive("Enemy3", true);
SetEntityActive("deformed_man", true);
PlaySoundAtEntity("", "break_wood_metal.snt", "spawnEnemy2", 0.0, false);
}
void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_wood", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood", 0, false);
RemoveItem(asItem);
}
void StartPlayerLookAt(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Look3", 3.0f, 3.0f, "");
AddTimer("", 3.0f, "StopLooking"); //Change 3.0f to how long you want the Player to look at it.
}
void StopLooking(string &in asTimer)
{
StopPlayerLookAt();
}
void OnLeave()
{
}
Fixed.
No offense, but did you actually learn all of this? We gave you a solution and did you even take a look at it? Or you just copy paste it to your script?
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
05-27-2013, 04:08 AM |
|
|