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
Keys on Doors...
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#5
RE: Keys on Doors...

Just for the sake of clarity: he didn't forget to declare
mansion_2 - he forgot to put it in quotes, and make it a string literal (that is: "mansion_2" ).

The compiler, reaching the token mansion_2 saw that it wasn't in quotes, so it assumed it's a variable, but it couldn't figure out what kind of variable it was, since such a variable was never declared.
A declaration is when you introduce a variable to your code, like this:
string targetDoor = "mansion_2";


This declares a string variable named targetDoor, which can then be used later on in various places in the code (assuming it's a global var), like this:
PlaySoundAtEntity("", "unlock_door", targetDoor, 0, false);
(This post was last modified: 12-01-2012, 09:15 PM by TheGreatCthulhu.)
12-01-2012, 09:13 PM
Find


Messages In This Thread
Keys on Doors... - by ryan1431 - 12-01-2012, 07:54 AM
RE: Keys on Doors... - by JMFStorm - 12-01-2012, 08:06 AM
RE: Keys on Doors... - by ryan1431 - 12-01-2012, 10:32 AM
RE: Keys on Doors... - by GoranGaming - 12-01-2012, 08:09 AM
RE: Keys on Doors... - by TheGreatCthulhu - 12-01-2012, 09:13 PM



Users browsing this thread: 1 Guest(s)