Frictional Games Forum (read-only)
quick question - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: quick question (/thread-5875.html)



quick question - LoneWolf - 12-24-2010

This comes up saying expected indentifier (356, 6)=

void switch(string &in asItem, string &in asEntity)
{


(rest isnt neccessary, says that the line, void switch... isnt identified right?).

What does this mean?

I have the void switch under a useitemcallback =

AddUseItemCallback("", "hammer", "lever1", "switch", true);



So the hammer is used on lever1 which activated the void switch. What is wrong with my void switch then?


RE: quick question - Frontcannon - 12-24-2010

Shouldn't that be an AddUseItemCallback?


RE: quick question - LoneWolf - 12-24-2010

Yes it is Smile i updated my post i put down some incorrect info. Anyway i have no idea what it means by unexpected identifier.

Here is all my scripting to do with it, and the part before it =



AddUseItemCallback("", "hammer", "lever1", "switch", true);

void switch(string &in asItem, string &in asEntity)
{

AddTimer("music", 1, "TimerMusicDelay10");

GiveSanityBoost();
CompleteQuest("Quest_2", "Switch");

PlaySoundAtEntity("06_break_wood.snt", "06_break_wood.snt", "06_break_wood.snt", 0, false);
PlaySoundAtEntity("16_ladder_imp1.snt", "16_ladder_imp1.snt", "16_ladder_imp1.snt", 0, false);
SetEntityActive("castle_portcullis_1", false);

SetEntityActive("lever1", false);
SetEntityActive("lever2", true);
SetEntityActive("lever3", true);

RemoveItem("hammer");

CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "ps_hit_wood.ps", false);
CreateParticleSystemAtEntity("", "ps_hit_metal.ps", "ps_hit_metal.ps", false);
}




Dont worry about how the 'adduseitemcallback' is positioned, its under onstart part and is with the rest, with } + { of course, i think i may have a spelling error but right now i cant see any, i have done this alot.

So hammer s used on Lever1, which activates switch function. So this cant be wrong?


RE: quick question - Frontcannon - 12-24-2010

Assuming that with '6' they mean the part behind switch.. try changing the func name. It looks like switch is syntax-related and shouldn't be used as a func name, but that shouldn't matter either because void designates it as a function, you should be able to put anything you want there...


RE: quick question - LoneWolf - 12-24-2010

Uhm... strangely enough that worked, i changed switch to switch12 just as a test, and it has worked now.

Hmmm... thanks.


EDIT: oh and i also have a small concern.

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_20", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_21", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_22", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_23", 0.0f, "");

This should mean that the enemy doesn't stop right? because he does for some reason... its annoying, he stops for like 1 sec.


RE: quick question - xiphirx - 12-24-2010

Yes, switch is syntax related.

http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Companion/cxx_crib/switch.html