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
quick question
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#1
quick question

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?
(This post was last modified: 12-24-2010, 08:05 PM by LoneWolf.)
12-24-2010, 07:48 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#2
RE: quick question

Shouldn't that be an AddUseItemCallback?


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
12-24-2010, 08:00 PM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#3
RE: quick question

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?
(This post was last modified: 12-24-2010, 08:18 PM by LoneWolf.)
12-24-2010, 08:17 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#4
RE: quick question

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...


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
12-24-2010, 09:06 PM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#5
RE: quick question

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.
(This post was last modified: 12-24-2010, 09:38 PM by LoneWolf.)
12-24-2010, 09:29 PM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#6
RE: quick question

Yes, switch is syntax related.

http://www-numi.fnal.gov/offline_softwar...witch.html

12-24-2010, 09:59 PM
Find




Users browsing this thread: 1 Guest(s)