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 → Trying to make an in-game map
Trying to make an in-game map
2004-09-25, 10:21 AM #1
I tried to make it so that you could press a button and the game would stop the player, freeze him/her, and then switch to a ghost thing in the level. Then, when the button is pressed again, it'd switch back.

I did a rather hack-job of using the force_jump.cog as a base, and I've no experience with creating custom powers and whatnot. What have I done incorrectly?

Code:
# Jedi Knight Cog Script
#
# FORCE_JUMP.COG
#
# FORCEPOWER Script - Force Jump
#  Basic Power
#  Bin 21
#
#  This ability is controlled by the length of the key press.
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

thing       player                           local

thing		cam1

message     startup
message     activated
message     deactivated
message     cyccam

end

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

code

startup:
   player = GetLocalPlayerThing();

   Return;

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

activated:

	Call cyccam;
	SetCameraFocus(0, cam1);
	StopThing(player);
	SetActorFlags(player, 0xa00000);

   Return;

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

deactivated:

	SetCameraFocus(0, player);
	ClearActorFlags(player, 0xa00000);

   Return;

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

cyccam:
    if((GetCurrentCamera() != 0)) {
	CycleCamera();
	}

return;

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

end
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2004-09-25, 3:35 PM #2
I'm afraid you can't deactivate a switch. And also, you haven't specified a switch. In the activated message, try for something like this:
Code:
activated:
        if(GetSenderRef()!=switch) return;
        If(i==0) {
	Call cyccam;
	SetCameraFocus(0, cam1);
	StopThing(player);
	SetActorFlags(player, 0xa00000);
        i=1;
        }
        else
        {
        SetCameraFocus(0, player);
	ClearActorFlags(player, 0xa00000);
        i=0;
        }
   Return;

And take away the deactivated.
Edward's Cognative Hazards
2004-09-25, 3:58 PM #3
No, no, no.

I want the player to specify a key on the keyboard that, when pressed, changes the view to the ghost object in the level. Then, when they press it again, it switches back to the player.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2004-09-26, 3:15 AM #4
AAAAAaaahh! OK...

Well, first off... Em... Hm... New key thingy...
items.dat file, very bottom, after 115
Code:
crncm			120		1	1	0x122	cog=NewView2000.cog

Now, that I have 0x122, you will need to create a BM with more or less the same name (iccrncm16.bm AND iccrncm8.bm, one 16-bit and another 8-bit).
If you don't want that, then choose 0x120.

Next, make sure a key can be binded to it:
jkstrings.uni file, find "ACTIVATE16", and add:
Code:
   "ACTIVATE17"      0 "Corner Camera"


Then finally, the COG.
I'm afraid that your COG won't work because you won't be able to assign a ghost thing, unless it is for a ModLevel, ie a level that you run as a Mod. Otherwise, you'll have to create a ghost thing somewhere from within the COG.

Hope this helps. Would you like to see the COG used for this "Corner Camera"?

/Edward
Edward's Cognative Hazards
2004-09-26, 7:51 AM #5
It is run as a mod. I have a .bat file that runs it.

I tried, as you said, though with x100 flags; what's the difference?
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2004-09-26, 10:04 AM #6
OK... 0x100 - Can be assigned to Key. 0x20 - It is available from start. 0x2 - Bin is used by an item.

For more referance, you can look it up in the DataMaster (aka The COG Bible).

__________________
SaberMaster
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

Hay. What ever happened to him?
Edward's Cognative Hazards
2004-09-26, 7:37 PM #7
Hmm. I tried with the i==0 kind of COG, and all it does is make the head disappear and then the view freezes, as though it can't find the thing I've assigned it to switch to.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2004-09-27, 8:01 AM #8
Hm... Is the COG in Placed COGs, and you've assigned the Cam to the right object? If it doesn't work, maybe you should make your thing local, and in the COG create your thing at a position, capture it, and set your view to that. Don't forget to delete the thing when you're done using it.

Here's something you can look at:
Code:
# Vertex Cam!
#
# By Edward
flags=0x240
symbols

message		startup
message		activated
message		pulse

template	g=+thecamerathat	local
template	looking=+wherehelooks	local
thing		gh=-1		local

sector		prev=-1		local

int		on=0		local

vector		lv		local
vector		lvr		local
vector		thevertex	local
vector		vertexpos	local

end
#
code
startup:
	on=0;
	SetPulse(0);
	SetCameraFocus(1,GetLocalPlayerThing());
	DestroyThing(gh);
	prev=-1;
return;
activated:
	If(on==0)
	{
		print("Corner Cam ON!");
		setInvActivated(player,120,1);
		on=1;
		prev=-1;
		SetPulse(0.01);
	}
	else
	{
		print("Corner Cam OFF!");
		setInvActivated(player,120,0);
		on=0;
		SetPulse(0);
		SetCameraFocus(1,GetLocalPlayerThing());
		DestroyThing(gh);
		prev=-1;
	}
return;
pulse:
	if(GetThingSector(GetLocalPlayerThing())!=prev)
	{
		SetCameraFocus(1,GetLocalPlayerThing());
		if(gh!=-1) DestroyThing(gh);
		gh=-1;
		
			vertexpos=GetSectorVertexPos(GetThingSector(GetLocalPlayerThing()), rand()*GetNumSectorVertices(GetThingSector(GetLocalPlayerThing())));
			thevertex=VectorAdd(vertexpos, VectorScale(VectorNorm(VectorSub(GetSectorCenter(GetThingSector(GetLocalPlayerThing())), vertexpos)), 0.1));
			gh=CreateThingAtPos(g,GetThingSector(GetLocalPlayerThing()),thevertex,'0 0 0');
		
		CaptureThing(gh);
		SetThingFlags(gh,0x10);
		SetCollideType(gh,0);
	}
	if(GetCurrentCamera()==1) FireProjectile(GetLocalPlayerThing(),looking,-1,-1,'0 0 0','0 0 0',0,0,0,0);
	prev=GetThingSector(GetLocalPlayerThing());
	lv=VectorSub(GetThingPos(gh),GetThingPos(GetLocalPlayerThing()));
	lvr=VectorSet(-VectorX(lv),-VectorY(lv),-VectorZ(lv));
	SetThingLook(gh,lvr);
	SetCameraFocus(1,gh);
return;
end

This here creates a ghost at a vertex possition and then follows the player. It has been set for External Camera.

Hope you'll get somewhere.

/Edward
Edward's Cognative Hazards
2004-09-27, 9:36 AM #9
Interesting... I'd like to see where this thread goes.
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2004-09-27, 10:21 AM #10
*fetches the pop-corn and joins Tazz* :)

Seriously, I think we could be going places with this thread - it's always good to see a different slant on implementation/conceived ideas. It's something that's strangely refreshing :D

-Jackpot
"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 ||

↑ Up to the top!