The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Need help understanding this
Shadowfied Offline
Senior Member

Posts: 261
Threads: 34
Joined: Jul 2010
Reputation: 5
#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


Messages In This Thread
Need help understanding this - by Shadowfied - 01-20-2012, 10:06 AM
RE: Need help understanding this - by Shadowfied - 01-20-2012, 11:56 AM



Users browsing this thread: 1 Guest(s)