Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help understanding this
Author Message
Shadowfied Offline
Senior Member

Posts: 261
Joined: Jul 2010
Reputation: 5
Post: #1
Need help understanding this

I'm messing around a bit with the entities from White Night just to try them out, particularly the lamps and lamp-switches, but I'm so confused.

I've inspected the White Night map and how the lamps and switches are placed and named etc and tried doing similar myself. It looks like in White Night, using this script:

void Lamp_Switcher(string &in asEntity, int alState)
if( alState == -1)
SetLampLit("swithcher_1_"+StringSub(asEntity,10,11), false, true);
if( alState == 1)
SetLampLit("swithcher_1_"+StringSub(asEntity,10,11), true, true);

Yeah using this script it seems that this is the only thing required and as long as the switchers and lamps are named correctly this is enough script. I tried doing the same, putting a switcher, naming it switcher_7 and a lamp (exactly same entity as in the place which I'm looking at in White Night) with the name switcher_1_7 and adding the "Lamp_Switcher" in the ConnectionStateChangeCallback box for the switch, but it doesn't work. If I just do it simple, removing the +StringSub parts etc it works, but then I'll have to make that script for every lamp and switch.

I don't understand what "+StringSub(asEntity,10,11) does..Especially "asEntity,10,11"....can anyone help me understand this?

Thanks in advance.

Current - Castle Darkuan
Other - F*cked Map
(This post was last modified: 01-20-2012 11:57 AM by Shadowfied.)
01-20-2012 10:06 AM
Find all posts by this user Quote this message in a reply
Post Reply 

Messages In This Thread
Need help understanding this - Shadowfied - 01-20-2012 10:06 AM

User(s) browsing this thread: 1 Guest(s)