James, on 06 August 2012 - 06:38 AM, said:
You've made the gamevar sector_pos a global one - you'll need to change it to a per-actor variable by changing it's definition to this:
gamevar sector_pos 0 2
The wiki tells you different values you can set gamevars, but for the most part you'll be using 0 as a global var, 1 as a player var, and 2 as an actor var. You'll also want to change timecounter to a per actor var, judging by your code

Many Thanks i didnt know this (im just a new to .CON) but problem is it still doesnt work...
If i do this:
define LIGHTING_ICON 3589
gamevar timecounter 0 2
gamevar okay 0 0
gamevar sector_pos 0 2
onevent EVENT_DISPLAYROOMS
ifrnd 0
{
ifrnd 64
{
soundonce THUNDER
setvar okay 1
}
}
endevent
useractor notenemy LIGHTING_ICON
{
cstat 32768
getactor[THISACTOR].sectnum sector_pos
ifvare okay 1
{
setsector[sector_pos].floorshade 20
setsector[sector_pos].ceilingshade 20
addvar timecounter 1
}
ifvare timecounter 40
{
setsector[sector_pos].floorshade 30
setsector[sector_pos].ceilingshade 30
setvar timecounter 0
setvar okay 0
}
}
enda
Then it isnt working properly, first one sector goes dark and return back, later another one, but both never goes dark and return together.
I tried also this without that "setvar okay 0":
ifvare timecounter 40
{
setsector[sector_pos].floorshade 30
setsector[sector_pos].ceilingshade 30
setvar timecounter 0
}
and its really close to what i need, but still is there problem, when both sectors goes dark, they keep blinking...
So we are very close, just tell me someone what im doing bad

why they are blinking...