NWN2 Toolset

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

lighting help (script question)

 
Post new topic   Reply to topic    NWN2 Toolset Forum Index -> NWN2 Scripting Help
View previous topic :: View next topic  
Author Message
tberry7348



Joined: 09 Jul 2007
Posts: 5

PostPosted: Tue Jul 10, 2007 12:57 am    Post subject: lighting help (script question) Reply with quote

i assume this won't work, eny suggestions what would?

if Street_lamp_o1.on? = false then
Street_lamp01.on? = true
else
Street_lamp01.on? = false
end if


street_lamp_01 is the tag for the light sorce for the streetlamps
street_lamp_post_01 is the tag for the lamp post i want clickable to turn on and off the light

on? is the property to turn on and off the light (i think).
the script above is how it would be set in vb or pritty close but i don't have a clue on how to do enything in c.... please help, i know this should be easy and probibly obvious, lol... but i'm lost!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Malice



Joined: 17 Oct 2007
Posts: 9
Location: Luton UK

PostPosted: Thu Oct 18, 2007 5:09 pm    Post subject: Reply with quote

If the Lightsource is made with separate blueprint:

Light Sources have a property of "On" basically, this can be TRUE or FALSE (no explanation required there Smile )

In script, this property can be changed with the function:
SetLightActive( object oLight, int bActive );

where oLight is the LightSoucce object
bActive is TRUE or FALSE

To efficiently switch between on/off, unfortunately, Obsidian do not include a GetIsLightActive() function, so It's recommended that an Integer be set on the lamppost or the light source to keep track of its on/off state


---------------------------------------------------------------------------

If the Lightsource is part of a Placeable Illumination:


SetPlaceableIllumination(object oLamp, int bActive );


(In theis case, oLamp refers to the parent LACEABLE, not the specific lightsource light itself.)

To Efficiently switch between On/O ff, this is a nice way to do it:

SetPlaceableIllumination(object oLamp,(!GetPlaceableIllumination(oLamp)));

NOTE:
You should ideally call
RecomputeStaticLighting(GetArea(oLamp));
After any Illumination changes (not after each individual one if you are doing more than one in an area at the same time, though)

_________________
------------------
PJ
Back to top
View user's profile Send private message Send e-mail
tberry7348



Joined: 09 Jul 2007
Posts: 5

PostPosted: Fri Oct 26, 2007 4:48 pm    Post subject: ty Reply with quote

thank you i had almost given up on finding help with that issue
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
tberry7348



Joined: 09 Jul 2007
Posts: 5

PostPosted: Sun May 04, 2008 6:39 pm    Post subject: thanks Reply with quote

ok, i'm a complete noob.....
baced on what was said above i tried this

Code:

void main()
{
    object oItem    = GetItemActivated();
   int bActive = TRUE
   SetLightActive( object oItem, int bActive );
}

and on compilation got

script1.nns(5) error: parsing variable list

so i didn't evin gets far enouph to test it Sad

lol, eny idea's where i went rong?

as a note there doesn't seem to be an onActivate in the lamppost script properties, if i put the sript on the OnUsedScript property will it still work the same? (just for the test run i'm useing the blueprint:placeables/manmade props/lamppost; with the standard tag and so on, will use my own blueprints once i figure out the basics)

ps:
i noticed i was missing a ";" above and went back added it and am still now getting a diffrent erron

Code:

void main()
{
    object oItem = GetItemActivated();
   int bActive = TRUE;
   SetLightActive( object oItem, int bActive );
}


new error:

Script1.nns(5): ERROR: UNKNOWN STATE IN COMPILER
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    NWN2 Toolset Forum Index -> NWN2 Scripting Help All times are GMT
Page 1 of 1

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum





Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.

Abuse - Report Abuse
Powered by forumup.com free forum, create your free forum!
Created by Raulken of Hyarbor S.r.l.
TOS & Privacy.

Page generation time: 0.028