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 Please help
mitkovarn Offline
Junior Member

Posts: 9
Threads: 2
Joined: Apr 2013
Reputation: 0
#1
Please help

Look at these pictures and tell me where is the wrong at the script (the script is for headless agripe (unactive) to appear when the player walk into the script area if you have ideas please help
Link1---->http://postimg.org/image/uj1u820mj/ (the error)
Link2---->http://postimg.org/image/qokwvc4dt/ (my sccript file)
04-27-2013, 05:53 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: Please help

You have to put the addentitycollidecallback in the OnStart section.

[Image: images?q=tbn:ANd9GcSVYSnOi8NlsD7QNJoz2Do..._sypqpjQ8Q]
(This post was last modified: 04-27-2013, 06:09 PM by OriginalUsername.)
04-27-2013, 06:07 PM
Find
ClayPigeon Offline
Member

Posts: 214
Threads: 13
Joined: Mar 2012
Reputation: 8
#3
RE: Please help

You have a function that is outside any callback.
Put AddEntityCollideCallback("Player", "ScriptArea_1", "NailThatSucker", true, 1); under OnStart().
04-27-2013, 06:07 PM
Find
mitkovarn Offline
Junior Member

Posts: 9
Threads: 2
Joined: Apr 2013
Reputation: 0
#4
RE: Please help

////////////////////////////
// Run first time starting map
void OnStart()
AddEntityCollideCallback("Player", "ScriptArea_1", "NailThatSucker", true, 1);
{
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
}

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

void NailTheSucker(sting &in asParent, string &in asChild, int alStates)
{
SetEntityActive("agrippa_headless_1", true);
AddPropForce("agrippa_headless_1", 0, 0, 0, world);
PlaySoundAtEntity("", "24_iron_maiden.snt", "agrippa_headless_1", 0, false);
}




somethink like this?
(still giving error even 2 errors)
04-27-2013, 06:19 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#5
RE: Please help

(04-27-2013, 06:19 PM)mitkovarn Wrote: ////////////////////////////
// Run first time starting map
void OnStart()
AddEntityCollideCallback("Player", "ScriptArea_1", "NailThatSucker", true, 1);
{
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
}

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

void NailTheSucker(sting &in asParent, string &in asChild, int alStates)
{
SetEntityActive("agrippa_headless_1", true);
AddPropForce("agrippa_headless_1", 0, 0, 0, world);
PlaySoundAtEntity("", "24_iron_maiden.snt", "agrippa_headless_1", 0, false);
}




somethink like this?
(still giving error even 2 errors)

No, inside the brackets:

void OnStart()
{
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "NailThatSucker", true, 1);
}
04-27-2013, 06:22 PM
Find
mitkovarn Offline
Junior Member

Posts: 9
Threads: 2
Joined: Apr 2013
Reputation: 0
#6
RE: Please help

http://postimg.org/image/5iugezp9j/ 3 errors
04-27-2013, 06:27 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#7
RE: Please help

(04-27-2013, 06:27 PM)mitkovarn Wrote: http://postimg.org/image/5iugezp9j/ 3 errors

When a error says main(15,20), the computer means there is something wrong in the 15th line, the 20th symbol. So you see: 'sting' is not a data type, so sting is nothing and it should be string.
when 'world' is not declared, it should be between "".
That should do it..I hope

Tip: I wouldn't type everything, just copy paste everything is a good way to prevent typos
(This post was last modified: 04-27-2013, 06:33 PM by OriginalUsername.)
04-27-2013, 06:31 PM
Find
mitkovarn Offline
Junior Member

Posts: 9
Threads: 2
Joined: Apr 2013
Reputation: 0
#8
RE: Please help

ty now the map is running but for what was all that writing the script wont work :X

so i am at the script and nothing is happening why?
(This post was last modified: 04-27-2013, 06:47 PM by mitkovarn.)
04-27-2013, 06:45 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#9
RE: Please help

(04-27-2013, 06:45 PM)mitkovarn Wrote: ty now the map is running but for what was all that writing the script wont work :X

so i am at the script and nothing is happening why?

Make sure all the names in-game are right. So the door is called 'door' (Or anything you like) They just have to match in the editor and your script file.
04-27-2013, 06:48 PM
Find
mitkovarn Offline
Junior Member

Posts: 9
Threads: 2
Joined: Apr 2013
Reputation: 0
#10
RE: Please help

i mean the script for the agripa is not working the script for the key and door is okey but the agripa's script wont work

if you want i will send you my map its 60kb

and yes the names are matching
(This post was last modified: 04-27-2013, 06:54 PM by mitkovarn.)
04-27-2013, 06:50 PM
Find




Users browsing this thread: 1 Guest(s)