Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → SoundSwitch Cog Prob...
SoundSwitch Cog Prob...
2003-08-21, 5:23 PM #1
Will the multiplayer problems ever cease? Now, I am using this cog...

# Jedi Knight Cog Script
#
# Adjusts Sector extralight on activation of a switch
#
# 11/20/98 Nightmare
# ========================================================================================

symbols

message startup
message activated

sound poweroff=activate04.wav
sound poweron=activate01.wav

surface switch

flex onlight=.75
flex offlight=0

int power local

sector sector00
sector sector01
sector sector02
sector sector03
sector sector04
sector sector05
sector sector06
sector sector07
sector sector08
sector sector09
sector sector10
sector sector11
sector sector12
sector sector13
sector sector14

end

# ========================================================================================

code

startup:
SetWallCel(switch,0); // set the switch to the on position

power=1;

SetSectorLight(sector00, onlight, 0); // set all sector light
SetSectorLight(sector01, onlight, 0); // values to "on"
SetSectorLight(sector02, onlight, 0);
SetSectorLight(sector03, onlight, 0);
SetSectorLight(sector04, onlight, 0);
SetSectorLight(sector05, onlight, 0);
SetSectorLight(sector06, onlight, 0);
SetSectorLight(sector07, onlight, 0);
SetSectorLight(sector08, onlight, 0);
SetSectorLight(sector09, onlight, 0);
SetSectorLight(sector10, onlight, 0);
SetSectorLight(sector11, onlight, 0);
SetSectorLight(sector12, onlight, 0);
SetSectorLight(sector13, onlight, 0);
SetSectorLight(sector14, onlight, 0);

return;

activated:
if(power == 0)
{
SetWallCel(switch,0); // do effects
PlaySoundPos(poweron, SurfaceCenter(switch), 1.0, -1, -1, 0);

SetSectorLight(sector00, onlight, 0); // set all sector light
SetSectorLight(sector01, onlight, 0); // values to "on"
SetSectorLight(sector02, onlight, 0);
SetSectorLight(sector03, onlight, 0);
SetSectorLight(sector04, onlight, 0);
SetSectorLight(sector05, onlight, 0);
SetSectorLight(sector06, onlight, 0);
SetSectorLight(sector07, onlight, 0);
SetSectorLight(sector08, onlight, 0);
SetSectorLight(sector09, onlight, 0);
SetSectorLight(sector10, onlight, 0);
SetSectorLight(sector11, onlight, 0);
SetSectorLight(sector12, onlight, 0);
SetSectorLight(sector13, onlight, 0);
SetSectorLight(sector14, onlight, 0);

power = 1;
return;
}

if(power == 1)
{
SetWallCel(switch,1); // do effects
PlaySoundPos(poweroff, SurfaceCenter(switch), 1.0, -1, -1, 0);

SetSectorLight(sector00, offlight, 0); // set all sector lights to
SetSectorLight(sector01, offlight, 0); // the "off" value
SetSectorLight(sector02, offlight, 0);
SetSectorLight(sector03, offlight, 0);
SetSectorLight(sector04, offlight, 0);
SetSectorLight(sector05, offlight, 0);
SetSectorLight(sector06, offlight, 0);
SetSectorLight(sector07, offlight, 0);
SetSectorLight(sector08, offlight, 0);
SetSectorLight(sector09, offlight, 0);
SetSectorLight(sector10, offlight, 0);
SetSectorLight(sector11, offlight, 0);
SetSectorLight(sector12, offlight, 0);
SetSectorLight(sector13, offlight, 0);
SetSectorLight(sector14, offlight, 0);

power = 0;
return;
}

return;

end

and my problem is that I modified it to support up to 100 sectors (yes, I need them all) and it works just fine for the host. but for some reason, the other player can see spots that are light and some that are dark. when the light is on(not activated) and all is bright.. everything is fine... but when one turns the light off.. the host can see the dark and all, and the other person can see some of it, but its patchy - like it is not being activated in some sectors. I tried linking about 7 of the original cog to one switch after my 100 sector one sucked but they did the EXACT same thing... so my modification isnt the problem. This is the LAST thing in my level. All else is done. Now I just need to get this last forsaken cog fixed and then my beloved level, *Harbor Havoc* will be completed. Lucky_Jackpot, SaberMaster, anyone PLEASE help! [http://forums.massassi.net/html/frown.gif]

------------------
Bob Dole likes peanut butter. Bob Dole's never been afraid to admit that

DANGIT!!!!!! I meant to type in lightswitch cog prob... sorry.

[This message has been edited by Darth_Bano (edited August 21, 2003).]
2003-08-22, 3:50 AM #2
Hi there [http://forums.massassi.net/html/smile.gif]

Do I hear a call for help [http://forums.massassi.net/html/wink.gif] lol

I'll take away what you've posted and try and sort your problem out (your code could be more efficient - *cough* arrays and loops *cough* [http://forums.massassi.net/html/wink.gif] ), but with most multiplayer cogs, I can't test it, because I don't have 2 machines [http://forums.massassi.net/html/frown.gif]

That said (from a curosry glance) the only thing that immediately strikes me is the missing "flags=0x40"...

-Jackpot

PS: I'll post back here with a more efficient cog script for you later [http://forums.massassi.net/html/smile.gif] Btw - did you say you wanted this to wrok for 100 sectors ?

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-08-22, 4:40 AM #3
Hi there [http://forums.massassi.net/html/smile.gif]

I believe this cog should work (it passed Parsec, so that's always a good start [http://forums.massassi.net/html/wink.gif] ), but please post back her if you have any questions/problems and we'll try and iron them out [http://forums.massassi.net/html/smile.gif]

Code:
##
# Jedi Knight COG Script File
#
# 00_sectorLightingControl.COG
#
# This script adjusts sector's extralight on activation of a switch.
#
# This COG is NOT supported by LucasArts or LEC
#
# Original script by Nightmare
# 11/20/98
#
# Modified by Jackpot (for multi-player purposes)
# 22-Aug-2003
# Extended sector count, to cater for 100 sectors.
# Set verbose=1 to display test messages, else keep at 0
#
# Email: lucky_jackpot@hotmail.com
# [RJS]
#
##

# ========================================================================================

# Flags Info...
# 0x40   -- Cog runs locally on each computer
# 0x200  -- Cog does NOT send synching info to other computers
flags=0x240

symbols

    message startup
    message activated

    sound poweroff=activate04.wav
    sound poweron=activate01.wav

    surface switch          linkid=1

    flex onlight=.75
    flex offlight=0

    int power                   local
    int numSectors=100     local      # This should be the same as the number of sectors used
    int counter                 local

    sector      sector00
    sector      sector01
    sector      sector02
    sector      sector03
    sector      sector04
    sector      sector05
    sector      sector06
    sector      sector07
    sector      sector08
    sector      sector09
    sector      sector10
    sector      sector11
    sector      sector12
    sector      sector13
    sector      sector14
    sector      sector15
    sector      sector16
    sector      sector17
    sector      sector18
    sector      sector19
    sector      sector20
    sector      sector21
    sector      sector22
    sector      sector23
    sector      sector24
    sector      sector25
    sector      sector26
    sector      sector27
    sector      sector28
    sector      sector29
    sector      sector30
    sector      sector31
    sector      sector32
    sector      sector33
    sector      sector34
    sector      sector35
    sector      sector36
    sector      sector37
    sector      sector38
    sector      sector39
    sector      sector40
    sector      sector41
    sector      sector42
    sector      sector43
    sector      sector44
    sector      sector45
    sector      sector46
    sector      sector47
    sector      sector48
    sector      sector49
    sector      sector50
    sector      sector51
    sector      sector52
    sector      sector53
    sector      sector54
    sector      sector55
    sector      sector56
    sector      sector57
    sector      sector58
    sector      sector59
    sector      sector60
    sector      sector61
    sector      sector62
    sector      sector63
    sector      sector64
    sector      sector65
    sector      sector66
    sector      sector67
    sector      sector68
    sector      sector69
    sector      sector70
    sector      sector71
    sector      sector72
    sector      sector73
    sector      sector74
    sector      sector75
    sector      sector76
    sector      sector77
    sector      sector78
    sector      sector79
    sector      sector80
    sector      sector81
    sector      sector82
    sector      sector83
    sector      sector84
    sector      sector85
    sector      sector86
    sector      sector87
    sector      sector88
    sector      sector89
    sector      sector90
    sector      sector91
    sector      sector92
    sector      sector93
    sector      sector94
    sector      sector95
    sector      sector96
    sector      sector97
    sector      sector98
    sector      sector99


    int     verbose=0


end

# ========================================================================================

code

startup:

    if (verbose)
    Print ("Start-up MSG...");

        // Set the switch to the "on" position
    SetWallCel (switch, 0);
    power = 1;

        // Set all sector light values to "on" - loops through array of sectors
    for (counter=0 ; counter<numSectors ; counter=counter+1) {
        SetSectorLight (sector00[counter], onlight, 0);
    }

    return;

#.........................................................................................

activated:

    if (GetSenderID() != 1) // Make sure nothing other than the "activating"
        return;                 // switch can send this message...

    if (power == 0)
    {
        if (verbose)
        Print ("Lights initially OFF - switch to ON...");
        SetWallCel (switch, 0); // do effects
        PlaySoundPos (poweron, SurfaceCenter (switch), 1.0, -1, -1, 0);

            // Set all sector light values to "on" - loops through array
        for (counter=0 ; counter<numSectors ; counter=counter+1) {
            SetSectorLight (sector00[counter], onlight, 0);
        }
        power = 1;
        return;
    }


    if (power == 1)
    {
        if (verbose)
        Print ("Light initially ON - switch to OFF...");
        SetWallCel(switch, 1); // do effects
        PlaySoundPos(poweroff, SurfaceCenter(switch), 1.0, -1, -1, 0);

            // Set all sector lights to the "off" value - loops through array
        for (counter=0 ; counter<numSectors ; counter=counter+1) {
            SetSectorLight (sector00[counter], offlight, 0);
        }
        power = 0;
        return;
    }

    return;

#.........................................................................................

end


Hope this helps... [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... [http://forums.massassi.net/html/wink.gif]

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)

[This message has been edited by lucky_jackpot (edited August 22, 2003).]
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-08-22, 5:01 AM #4
Just had a late thought ... the patches of light you refer to - this could well be mored editing that cog scripting. Remember that when you create extruded sectors, reshape them, and then pull them back into position, that you are "creating" a sort of "interlinking" area - and these are sectors as well, so if the lighting isn't set for them as well.... [http://forums.massassi.net/html/wink.gif]

(Eg: I guess the best example is that of one where you create a switch, it is *almost* a sector "within" a sector; the two both have independent light values...)

Or heck ... alternatively I could just be plain wrong [http://forums.massassi.net/html/wink.gif] lol Hope all this info helps [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-08-22, 2:00 PM #5
Well, I dont have two machines... just a crazy Jk lover of a friend [http://forums.massassi.net/html/smile.gif]. But about the sector prob - I used the alt-drag command to multiselect them all ( they were on their own layer) so i am pretty sure that that is all ok(i checked twice). Im pretty sure its just a piece of crap cog... And alas... I will take your wonderful cog and put it in my level.... but no one will hear anymore from me for a while - College! So I will do my best to fix my level and release it as soon as possible... Oh yeah, THANKYOU again, and again. Your just a lifesaver [http://forums.massassi.net/html/biggrin.gif]

------------------
Bob Dole likes peanut butter. Bob Dole's never been afraid to admit that
2003-08-22, 5:09 PM #6
NNooooooooooooo!!!! Can't finish level yet... All packed [http://forums.massassi.net/html/frown.gif]. See ya later. Ill try to get done as soon as I buy a new comp... which may take forever [http://forums.massassi.net/html/frown.gif]...

------------------
Bob Dole likes peanut butter. Bob Dole's never been afraid to admit that

↑ Up to the top!