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 → 3do creation cog
3do creation cog
2004-05-12, 11:26 AM #1
I'd like a cog which, upon entering a particular set of sectors, will put a local template in front of the players camera, kinda like a choice menu, or whatever. If it could adapt to camera location depending on first or third person, that'd be great... if not, two copies of the same object, one roughly where the third person camera is, and another in front of the player's position. Upon leaving the selected sectors, the objects are destroyed. Oh, forgot to mention, what I'd want is an MP cog. The creation of the templates should be local, so only whichever player entered the sector can see them. (That's possible, right?)

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come

[This message has been edited by LKOH_SniperWolf (edited May 12, 2004).]
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-12, 11:57 AM #2
What would happen if two players entered the same sector at the same time?

Oh, and I don't know if this is marginally helpful, but instead of a camera adjusting, maybe you could just have the player adjust. I don't know anything about cog, at least the language itself, however I do remember there being a cog in JK that adjested the player's position when a cutscene was triggered (assuming you want this to be a cutscene). Give me a sec and I'll see if I can find the cog in JED.

You might be able to use it in some way, even if not in the contect I designated it.

------------------
~ Vader's Corner ~
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-05-12, 12:04 PM #3
Ahh, here itis, it might* be even more relevant than I thought it was. Go to the F7 cogs and go to "Res2.gob>cog" and select "00_playerstarts.cog" from the selection. The description fllows as, " This cog sets the player startpoint once the player enters the referenced sector"

Sounds like it might work for some of what you're doing? [http://forums.massassi.net/html/confused.gif]

*I'm probably wrong

------------------
~ Vader's Corner ~
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-05-12, 12:27 PM #4
I don't want the camera to change. What I was saying, was adjusting the position of the created template depending on the camera's location, ie, whether it's in first or third person... First person, in front of the player location, third person, in front of the camera, which in that case would be behind the player. And if this weren't possible, I'd want two copies of the template, one in front of the player, and one in front of the third person camera...

Either way, I didn't want to move the player at all, or the camera for that matter. As for multiple players, hopefully, each one would have his own locacl object following him around...

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-12, 10:15 PM #5
Hm... Are you trying for a little comunicator thing? Something like what you have in Unreal? If so, I know what you need.
First off, your template shall be a sprite and a timer=0.2.
Then, Set COG flags to 0x240 (that would be before the word symbols).
Then, when you enter (now this is simple cause I don't know exactly where the External cam is) capture the camera state in an int. [ int camerastate local - camerastate=GetCurrentCamera(); ]
Test it: [ If(camerastate==1) CycleCamera(); ] if( external ) then Toggle to Internal.
Capture the player: [ thing player local - player=GetSourceRef(); ]
Then set a pulse on 0.1, and Fire the sprite. [ FireProjectile(player,menu,-1,-1,'0 .2 0','0 0 0',0,0,0,0); ] Now, I'm not sure about the first vector. You'll have to experiment...
Then an exit message where you stop the pulse, and SetCurrentCamera(camerastate);
And End!

If you want so that the sprite appears for the external view, then don't ask me.
If you want something different, I'll see if I can cook something up...

/Edward


[This message has been edited by Edward (edited May 13, 2004).]
Edward's Cognative Hazards
2004-05-13, 7:58 AM #6
[http://blargh.mine.nu/test/198/71084469657.gif]

Rough sketch, but you can get the idea. And the more general, the better, as I've thought of multiple ways it could be used (some with slight modification). 3do, not sprite... In case camera location couldn't be found, would want a two copies of the same template, one at each of the locations.

Edward, I'm looking at your code, trying to figure out if I can use it... maybe some, but yeah, this is for MP, so shouldn't really interfere with normal playing of game... Heh, I could do without the effect, but it's something I want for my level. I intend the level to be something nice to play in, and look at, but also be something of a showcase for everything JK is capable of. As I said though, I've also thought of several uses for the code, lol.

Hmm, maybe I could create two different templates, add a long invisible piece, and attach them to the 3do, changing model depending on which camera view the player is in...

As a template...

O ______|
|/------|
A

Something like that, with the weird stick figure on the left being the player. (The underscores are only there as spacers... the dashes are the invisble piece attaching the template...) Hmm, maybe that would work.

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come

[This message has been edited by LKOH_SniperWolf (edited May 13, 2004).]
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-13, 9:59 AM #7
Hm... I see... OK, if you want a translucent screen then it will have to be 3DO instead of sprite, but I think it shall be a timer=0.2 and a pulse of 0.1 creating it all the time. And I don't think you'll need 2 templates. Is it the same message infront as behind? Then you'll need only one template, but have 2 FireProjectiles. One fireing the object behind and one fireing infront. A yes... Here we go:
Code:
pulse:
      if(GetCurrentCamera()==0)
      {
        FireProjectile(player,menu,-1,-1,'0 0.2 0','0 0 0',0,0,0,0);
      }
      else if(GetCurrentCamera()==1)
      {
        FireProjectile(player,menu,-1,-1,'0 -0.2 0.1','0 0 0',0,0,0,0);
      }
return;

Just a piece of the code. And I'm not sure about the offset, you'll have to experiment.
Anyway, instead of 2 templates and an invisible piece between, you have one template that either displays infront or behind you. One slight problem with having 2 objects infront and behind is that when you have External View selected, you'll see 2 screens. One behind the player, and one infront of the player.
Well, hope this helps. if not, then, I'll see what I can do... *shift eyes and returns to the shadows*
Edward's Cognative Hazards
2004-05-13, 11:01 AM #8
This could be used for an in-game command menu, maybe for a RPG-type thing.

http://www.lucasarts.com/products/swkotor/images/screens/37.jpg

------------------
Check out updates for my editing work at the Shadow Jedi Academy.
2004-05-13, 12:39 PM #9
Hmm, yeah, that was kinda one of the ideas that occurred to me, as multiple uses. Or overlay screen, or other things. I have a specific use in mind.

Hmm, anyone know Savage's e-mail? Maybe I'll ask him, he had something similar to what I want for SS3... though hopefully it wouldn't require too much modification for use as a level cog.

I'll probably try Edwards method as well. And Edward, your method should solve the camera location problem, I think. Heh, I kinda suck with cog, so this may take me a while.

I just don't know it well enough, lol. I program C, C++, and J++, and some VisC++ and VB... Lol, but I just don't know enough about cog to do it. Someone needs to write a good tutorial for programmers, lol.

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-13, 3:40 PM #10
SavageX doesn't use earthlink anymore (like his massassi profile says); now he uses yahoo:
savagex378@yahoo.com

I'm pretty sure he'd be glad to help you.

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.
May the mass times acceleration be with you.
2004-05-13, 10:09 PM #11
LKOH_SniperwWolf: Some good tutorials for programming cog can be found at SaberMaster's site: http://www.geocities.com/sabersdomain/ which also contains the updated version of the DataMaster - a.k.a The COG BIBLE [http://forums.massassi.net/html/biggrin.gif]. A truly shameless plug [http://forums.massassi.net/html/wink.gif] for SM, as he isn't around as often anymore [http://forums.massassi.net/html/frown.gif]

Anyways, hope this helps [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

[EDIT: I hate blooming URL tags... [http://forums.massassi.net/html/rolleyes.gif]]

------------------
"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" - by Adam Lindsay Gordon)

[This message has been edited by lucky_jackpot (edited May 14, 2004).]
"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 ||
2004-05-14, 7:07 AM #12
Custom Crosshairs Tutorial
Studying crosshair.cog will probably be helpful in this project; It's pretty much the method Edward suggested.

Client/Server Cog Tutorial
This might help you because you want the cog to be local. I think the most important part of that tutorial is this:
Code:
flags=0x240    // The most important line in this entire cog.
                  It tells the cog to run locally on each clients machine,
                  and to not sync itself with the other client cogs.
                  (0x200 local, 0x40 no sync)


------------------
Check out updates for my editing work at the Shadow Jedi Academy.
2004-05-17, 1:52 PM #13
Ok, so I tried creating a cog. It didn't work. By all logic, I believe it should have, but it didn't.

Code:
flags=0x240  // Mark it local and unsynced.

symbols

sector      exSec1
sector      exSec2
sector      exSec3
sector      exSec4
sector      exSec5
sector      exSec6
sector      exSec7
sector      exSec8
sector      exSec9
sector      exSec10
sector      exSec11
sector 	    exSec12
sector 	    exSec13
sector 	    exSec14
sector 	    exSec15
sector 	    exSec16

template    firstTemplate
template    secondTemplate

thing       player	       local

float       PULSERATE = .1     local

message     pulse

end

code

startup:
    // Assigns player to the local player.
    // Though I've heard there's problems with this in MP, according to the sources I've read, it should work because the flags mark this cog local.

    player = GetLocalPlayerThing();
    SetPulse(PULSERATE);
return;

pulse:
    // Alright, this whole thing is just one long if statement.
    // It should check, if the local player is any of these sectors.
    // If so, the if statement should execute.

    if ((GetThingSector(player) == exSec1) || (GetThingSector(player) == exSec2) ||
        (GetThingSector(player) == exSec3) || (GetThingSector(player) == exSec4) ||
        (GetThingSector(player) == exSec5) || (GetThingSector(player) == exSec6) ||
        (GetThingSector(player) == exSec7) || (GetThingSector(player) == exSec8) ||
        (GetThingSector(player) == exSec9) || (GetThingSector(player) == exSec10) ||
        (GetThingSector(player) == exSec11) || (GetThingSector(player) == exSec12) ||
        (GetThingSector(player) == exSec13) || (GetThingSector(player) == exSec14) ||
        (GetThingSector(player) == exSec15) || (GetThingSector(player) == exSec16)){

    // If camera is in POV, shoot template to .2, .1; otherwise, to .2

        if(GetCurrentCamera()==0){
            FireProjectile(player,firstTemplate,-1,-1,'0 0.2 0.1','0 0 0',0,0,0,0);
        }
        else{
            FireProjectile(player,firstTemplate,-1,-1,'0 -0.2 0','0 0 0',0,0,0,0);
        }
    }

return;

end


------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-17, 5:58 PM #14
You're missing the "startup" message declaration in the symbols section. [http://forums.massassi.net/html/smile.gif]

------------------
for(i = 0; i < 00; i = i + 1) Print("massassi is good");
PrintInt(i); //print the integer value of infinity
May the mass times acceleration be with you.
2004-05-17, 7:33 PM #15
... D'oh!!!...

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-18, 8:31 AM #16
Couldn't your big fat if statement be done by a for loop?

------------------
Check out updates for my editing work at the Shadow Jedi Academy.
2004-05-18, 10:49 AM #17
For loop code instead, you can try this one. You should add "int i local" to the symbols section as well.

Simply replace your pulse message with this one.
Code:
pulse:
    // Alright, this whole thing is just one long if statement.
    // It should check, if the local player is any of these sectors.
    // If so, the if statement should execute.

    for(i = 0 ; i < 15 ; i = i + 1) {
        if (GetThingSector(player) == exSec1) {
            // If camera is in POV, shoot template to .2, .1; otherwise, to .2        
            if(GetCurrentCamera()==0) {            
                FireProjectile(player,firstTemplate,-1,-1,'0 0.2 0.1','0 0 0',0,0,0,0);        
            }        
            else {            
                FireProjectile(player,firstTemplate,-1,-1,'0 -0.2 0','0 0 0',0,0,0,0);        
            }
        }
    }

return;


------------------
for(i = 0; i < 00; i = i + 1) Print("massassi is good");
PrintInt(i); //print the integer value of infinity

[This message has been edited by Darth Slaw (edited May 18, 2004).]
May the mass times acceleration be with you.
2004-05-18, 2:24 PM #18
If you read what I said, I don't know cog that well, so don't know what works in it. Had to look up arrays, actually, lol. And at first I was thinking that would increase the amount of comparisons, but it shouldn't... Wait, actually it could. Slightly increasing worst case complexity. Haha, meaning it's more optimized this way. But for some reason, it's not working in the slightest.

It's as though the pulse is never being executed, though I have no friggin' idea why. I've tried replacing the constant with just a plain number...

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-18, 5:33 PM #19
Try putting a print statement in the pulse, to see if it's running at all.
This code looks aokay to me, but I might be overlooking something...

------------------
for(i = 0; i < 00; i = i + 1) Print("massassi is good");
PrintInt(i); //print the integer value of infinity
May the mass times acceleration be with you.
2004-05-18, 5:39 PM #20
Yeah, I did that. A print at the beginning of pulse, but it didn't seem to work. I'll run the thing through more tests later, try and figure out what the hell is going on...

------------------
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-05-19, 2:48 PM #21
Maybe try adding "sleep(1);" at the beginnihg of the startup message will help.

I'm out of ideas otherwise.

------------------
for(i = 0; i < 00; i = i + 1) Print("massassi is good");
PrintInt(i); //print the integer value of infinity
May the mass times acceleration be with you.
2004-05-20, 8:10 AM #22
Just throwing out some ideas:
  • Maybe Print() something inside the if statement to make sure that is working?
  • Are your 3dos valid and show up ingame normally?
  • Are the offsets for FireProjectile in a location where you can see them?


------------------
Check out updates for my editing work at the Shadow Jedi Academy.

↑ Up to the top!