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 → Wonder if this is possible...
12
Wonder if this is possible...
2004-06-04, 5:59 AM #1
Hello fellow JK-fanatics.

I was having a new idea for my level, but I don't even know if it's possible...anyway here goes:

Is it possible to make a cog that 'switches' Force Powers in a certain sector? So, for example, you are Level 8 Lighty, and your 4 lightside powers are healing, blind, persuasion and absorb. When you do a blind in that sector, you'll do the dark opposite instead (In this case Lightning, I think), and the other way round, you'll do persuasion when you try a grip. So basically, what the cog has to do, is switch the 4 lightside and darkside powers in that certain sector.

I wonder if it can even be done... and it would have to work with SBX as well. Although SBX changes the way the force powers work, I don't think it will interfere with the cog, because I assume that the 'assignements' of the Force Powers remains the same in level cogs. Unless this cog would require changing the workings of the Force Powers, or am I mistaken?

Anyways, if it's going to be a pain to make it, nevermind. It's just an idea I have.

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-04, 9:16 AM #2
It should be possible. Though I don't know about getting it to work with SBX...

------------------
_ _ _____________ _ _
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-06-07, 12:26 PM #3
I see. Would anyone be willing to give it a try? The idea is very cool, in my humble opinion. If it's too much work, I understand. [http://forums.massassi.net/html/smile.gif]

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-09, 4:32 PM #4
Is my idea uncool? Is it too much work? Or did I make myself hated? I'm sorry if I insulted anyone, I wasn't meaning to. I'm just clumsy with my choice of words now and then. =\

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-11, 9:07 AM #5
I see no way you could do this without changing all the force power cogs...

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-06-11, 3:30 PM #6
I am offended by your suggestion. You racist, you. [/sarcasm]

Really, I see no reason to do that...

JediKirby

------------------
-Proud Leader of the Minnessassian Council
<]-[ellequin> Nothing is quite as satisfying as placing a .177 lead pellet in between the eyes of a cat.
<]-[ellequin> I think I will leave it's corpse there, to warn all the other cats to keep out of my hibiscus patch

Live on, Adam.
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2004-06-11, 4:15 PM #7
Ok, I'll explain. The idea of the room is this:

It's this secret, mystical place somewhere deep in the temple that I'm making. (It's also going to be used for RPG) I am planning to use that room for Jedi Trials. When someone goes in there, he will suddenly have other powers, and what will he do with it? Upon entering, he will be confronted with 'his other side', much like the Tree on Dagobah, where Luke goes in. Only, it's a little different. You, yourself suddenly possess the opposite powers of what you stand for. So, in a way, this room is a mystical place where one can learn about the power of the other side.

And also it's practically really cool to be able to 'switch sides' in a certain room.

But if the only way is re-writing all the Force Powers, nevermind!

Thanks for reaction =)

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-12, 12:27 AM #8
What could be done in a single cog, is, switching the force power stars upon entering the sector(s). So, let's say you have 3 stars on healing and 2 on blinding. Now, in this sector(s) you would have 3 on throw and 2 on lightning.

[edit2]
I've had a cog that does this, but it seems that the change has no effect ingame. Although it displays 4 stars on "Healing" where you had 4 on "Throw" before, you still have the same powers...
[/edit2]

But it's really not possible to "activate" other force powers by pressing a certain force power's hotkey. At least not without changing the code of all affected force power cogs.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

[This message has been edited by zagibu (edited June 12, 2004).]
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-06-12, 3:57 AM #9
Hmmm, well I have no idea about the technicalities, but maybe this will work:

Let's say that, upon entering the sector, the player will be notified with a message that his Force Powers have changed;

he or she will now have the opposed powers, but will still have to use the hotkeys that 'belong' to those powers. So if you're a lighty and you have dark powers now, you will nonetheless have to use the 'original hotkeys' for the dark powers.

Lol, long story, what I actually mean to ask is: Could it be done if we leave that hotkey-thing out?

Because well, I've seen people übering (I hate it, lol), but they do have all the powers with that one cog. So maybe it's an idea to modify the 'über cog' (if it's a cog, I don't even know, lol) in some kind of way? (Sorry if this doesn't make any sense, I can build levels but I don't know a thing about cogs.)

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=

[This message has been edited by ORJ_JoS (edited June 12, 2004).]
ORJ / My Level: ORJ Temple Tournament I
2004-06-12, 3:18 PM #10
If you can find this cog...post it here. We might work something out, then. But I don't think it's a single cog. Those cheaters probably use hacked versions of all force power cogs.
Not sure, though. Maybe someone else is more familiar with forces?

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-06-13, 9:39 AM #11
No, I don't have it. Someone else told me it's a modification, not a cog. =\ And I'm not even sure if it's going to help. Hmmm, yeah... we need an expert...lol

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-13, 12:53 PM #12
Well I won't kid you - it's infintitely more difficult to design this type of thing if you don't have the source-code to hand [http://forums.massassi.net/html/redface.gif]. Should you find it though, we'll certainly be able to debug it, one way or another [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/biggrin.gif]

Like zagibu touched upon, it's unlikely (although not impossible) to be just one cog alone. However - if you've been playing a game and seen it done, you will have the source-code, courtesy of the gob/goo file you (or your friends) were using [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/biggrin.gif]

Hope this helps [http://forums.massassi.net/html/biggrin.gif] - if you could find out even the level name, then it would be a start [http://forums.massassi.net/html/smile.gif]

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

And he's finally off the starting grid --> Zooooom -@%
"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-06-13, 3:48 PM #13
No, I didn't see it in a level. I may have been a bit unclear, sorry.

I was just thinking about how 'übers' get all the Force Powers. I thought it was some kind of built-in-cog in JK that lets you über if you enter the command ingame. I was thinking, if it's a single cog, then maybe it's possible to modify it. But I've been told that there is no such thing as an 'über cog'... I have no source code at all.

I can't think of any cogs that do something like I want.

But suppose you edit all the seperate Force Power cogs, would that be a lot of work? And would it be possible then to have this 'switch' effect only in (a) certain sector(s)?

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=

[This message has been edited by ORJ_JoS (edited June 13, 2004).]
ORJ / My Level: ORJ Temple Tournament I
2004-06-13, 4:25 PM #14
Playing uber, is rather easy. You simply modify the character file, and add more force stars, without modifying rank. It's got number, like 3.00, 2.00, 4.00. If you set them all to 4.00 (rank is different, it determines force rank, in terms of what's acceptable for the game... even at 0, force powers can still be used, though you won't have as much mana).

I believe what you want is possible.

It should be possible to do it for certain sectors, but it would require modifying all the force power cogs, I believe, and then sending out a trigger of some sort, to have them do something different.
It would also double the code, because you'd need to duplicate code for each power in it's opposite.
Basically, you'd enter a sector, it'd send out a message to the force power cogs telling them to switch states, and use alternate force power code...

That should work, but would require a lot of coding.

------------------
_ _ _____________ _ _
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-06-13, 4:51 PM #15
The 'uber' cog equivalent is

for(i = 21; i <= 34; i = i + 1)
{
SetInvAvailable(player, i, 1);
ChangeInv(player, i, 4);
}

I really dont see the problem with reversing force powers, i dont think you would have to modify the individual force cogs. It might be a pain to matchup the exact number of stars given to each, I would keep it simple and try:

// Give Lightside
for(i = 25; i <= 29; i = i + 1)
{
SetInvAvailable(player, i, 1);
ChangeInv(player, i, 4);
}

// Remove Lightside
for(i = 25; i <= 29; i = i + 1)
{
SetInvAvailable(player, i, 0);
ChangeInv(player, i, 0);
}

// Give Darkside
for(i = 30; i <= 34; i = i + 1)
{
SetInvAvailable(player, i, 1);
ChangeInv(player, i, 4);
}

// Remove Darkside
for(i = 30; i <= 34; i = i + 1)
{
SetInvAvailable(player, i, 0);
ChangeInv(player, i, 0);
}

I lack the time to test right now, but i believe this method would work.



[This message has been edited by The_New_Guy (edited June 13, 2004).]
- Wisdom is 99% experience, 1% knowledge. -
2004-06-13, 6:51 PM #16
You obviously missed zagibu's comment. He mentioned it not having an effect ingame.

Quote:
<font face="Verdana, Arial" size="2">
What could be done in a single cog, is, switching the force power stars upon entering the sector(s). So, let's say you have 3 stars on healing and 2 on blinding. Now, in this sector(s) you would have 3 on throw and 2 on lightning.

[edit2]
I've had a cog that does this, but it seems that the change has no effect ingame. Although it displays 4 stars on "Healing" where you had 4 on "Throw" before, you still have the same powers...
[/edit2]

But it's really not possible to "activate" other force powers by pressing a certain force power's hotkey. At least not without changing the code of all affected force power cogs.
</font>


------------------
_ _ _____________ _ _
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-06-13, 10:18 PM #17
No, he's right. I have made a mistake in my cog before. I forgot the SetInvAvailable() statement. Now it works:
Code:
symbols

flex	forceCacheL	local
flex	forceCacheD	local

sector	forceTwist

thing	player		local

message	entered
message	exited

end

code

entered:
exited:
	player = GetSourceRef();
	if(GetSenderRef() == forceTwist)
	{
		for(i = 0; i <= 4; i = i + 1)
		{
			forceCacheL = GetInv(player, 25 + i);
			forceCacheD = GetInv(player, 30 + i);

			if(forceCacheL == 0)
				SetInvAvailable(player, 30 + i, 0);
			else
				SetInvAvailable(player, 30 + i, 1);
			if(forceCacheD == 0)
				SetInvAvailable(player, 25 + i, 0);
			else
				SetInvAvailable(player, 25 + i, 1);

			SetInv(player, 25 + i, forceCacheD);
			SetInv(player, 30 + i, forceCacheL);
		}
	}
	Return;

end


------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-06-14, 4:32 AM #18
That's all??????? Wowzors!!!! Thanks, I'm going to test this! [http://forums.massassi.net/html/biggrin.gif]

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-14, 5:05 AM #19
[http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/biggrin.gif] IT WORKS!!! WITH SBX TOO!!! [http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/biggrin.gif]

w00000000000t!!!

I still gotta test it on clients comp, did a quick test on 1 comp only.

Thanks a billion, people...

Credits go to all the contributors [http://forums.massassi.net/html/biggrin.gif]

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-14, 2:38 PM #20
I tested it on two comps and it's not working on the client. No anomalies, it's just not working; you keep the same powers you had before.

I'd be very glad with a fix for that. [http://forums.massassi.net/html/smile.gif]

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-14, 5:24 PM #21
simple fix... I think...

add
Code:
flags=0x40
at the top of the cog above 'symbols'.

------------------
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2004-06-15, 1:18 AM #22
Heck while you're at it, you may as well make it play solely on the client: flags=0x240 (combination of both no synch and local-effect only cog), I would suggest... [http://forums.massassi.net/html/smile.gif]

-Jackpot

NB: Only cursory scanned this thread from the last time I posted, but it should work (hopefully)... [http://forums.massassi.net/html/redface.gif] [http://forums.massassi.net/html/wink.gif]

------------------
"lucky_jackpot is the smily god..." - gothicX
"jackpot is an evil evil man... so evil, in fact, that he's awesome." - Seb

"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 ||
2004-06-15, 4:54 AM #23
[http://forums.massassi.net/html/biggrin.gif] That works! I used 'flags=0x240'. Thanks, people, this will make for an ultra-cool addition to my level. [http://forums.massassi.net/html/smile.gif]

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=

[This message has been edited by ORJ_JoS (edited June 15, 2004).]
ORJ / My Level: ORJ Temple Tournament I
2004-06-15, 1:24 PM #24
Glad we could all help you [http://forums.massassi.net/html/biggrin.gif] - personally I love it when something finally works [http://forums.massassi.net/html/wink.gif] - normally I settle for just "anything" that works, but once you've spent days on something, the relief sets in when you finally have the problem cracked [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
"lucky_jackpot is the smily god..." - gothicX
"jackpot is an evil evil man... so evil, in fact, that he's awesome." - Seb

"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 ||
2004-06-16, 5:50 AM #25
That's right, Lucky.

But just out of curiosity...I am trying to understand the coding in cogs, so I was wondering...why does this cog execute on 'exited'? I mean it works, but you'd think it would have to execute on 'entered'.

Furthermore, I am trying my first weenie little attemps at adding my own code, so I tried to add a text message and a sound upon entering the sector. It works, but maybe you guys could have a look at how I did it, and tell me what could be better. Also, I copied a part of the soundline from another cog, but I have no idea what the flags mean. I am referring to the line:

playsoundlocal(entry_snd, 1, 0, 132);

I have no idea what "1, 0, 132" does.

Anyway here's my modified version, have a look:


code

# Jedi Knight Cog Script
# ForceTwist.cog
# Switches Light and Dark powers in specified sector
# 06/2004 by Zagibu; minor fixes by The_New_Guy & Lucky_Jackpot
flags=0x240
symbols
flex forceCacheL local
flex forceCacheD local
sector forceTwist
thing player local
sound entry_snd=accomplish1.wav
message entered
message exited
end

code

entered:
playsoundlocal(entry_snd, 1, 0, 132);
Print ("...you sense a great disturbance in the Force here...");
Sleep(2.5);
Print ("...your normal powers seem to have faded...");
Sleep(2.5);
Print ("...you feel the powers of the other side within you...");
Sleep(2.5);
exited:
player = GetSourceRef();
if(GetSenderRef() == forceTwist)
{
for(i = 0; i <= 4; i = i + 1)
{
forceCacheL = GetInv(player, 25 + i);
forceCacheD = GetInv(player, 30 + i);
if(forceCacheL == 0)
SetInvAvailable(player, 30 + i, 0);
else
SetInvAvailable(player, 30 + i, 1);
if(forceCacheD == 0)
SetInvAvailable(player, 25 + i, 0);
else
SetInvAvailable(player, 25 + i, 1);
SetInv(player, 25 + i, forceCacheD);
SetInv(player, 30 + i, forceCacheL);
}
}
Return;
end



------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-17, 12:41 AM #26
Hey - good to see you're "learning the ways of the COG" [http://forums.massassi.net/html/biggrin.gif]. However, there are a couple of things you should be aware of with your new additions and I'll do my best to cover the majority of them (I make no promises as to covering all of the cog...):

First off, download the DataMaster v 0.6.1 at SaberMaster's site: http://geocities.com/sabersdomain/ - this is your one stop guide to all things cog related (now branching out marginally to cover broader areas of JK) - a.k.a The COG BIBLE. This will stand you in good stead for as long as you choose to edit JK [http://forums.massassi.net/html/biggrin.gif]

And now the fun stuff [http://forums.massassi.net/html/wink.gif] - with regard to your question "why does this cog execute on 'exited'? I mean it works, but you'd think it would have to execute on 'entered'.", note that zagibu's original code states
Code:
entered:
exited:
    [code block here...]


Normally, each message code-block is terminated by "Return" or "Stop" and control returns to the game. Zagibu's code is the one exception to the rule, whereby any messages that send an "entered" event message will be "carried over" (so to speak) into the "exited" message block. In short, the program flow runs from the initial code-block into the latter. Some of the original LEC cogs use this method.

One thing that I strongly advise against doing is implementing the "Sleep()" verb for MP. I know that in this case you're making the cog execute locally and not synching it with the server, but it makes for good cog programming practice. Timers or pulses (depending on what you're trying to achieve) would probably be better alternatives. This all said and done, "Sleep()" is by no means redundant - it's fantastic for SP scripting delays [http://forums.massassi.net/html/smile.gif]

As personal preference, I don't like including "Print()" statements in MP (partly because "Print()" used on a server cog, only displays on the host and not the clients, as well as the fact that if you're dueling someone, the last thing you want to see/hear is a sound and text appearing on the top of your screen that you feel the need to read (whilst getting your a$$ fragged by another player [http://forums.massassi.net/html/wink.gif])

With regard to the flags settings etc, I think the verb format is "PlaySoundLocal (wav_sound, volume, panning, flags)" (I'm at work at the moment and don't have access to the DataMaster, so my memory could be failing with my old age... [http://forums.massassi.net/html/redface.gif]). As I've already mentioned though, the DataMaster has (virtually) everything documented, so you find out this information exactly and tailor it to your cog requirements [http://forums.massassi.net/html/smile.gif]

Anyways - that's a good start - keep up the tinkering process. Hope this info has helped [http://forums.massassi.net/html/biggrin.gif]

------------------
"lucky_jackpot is the smily god..." - gothicX
"jackpot is an evil evil man... so evil, in fact, that he's awesome." - Seb

"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 ||
2004-06-17, 2:17 AM #27
if you dont mind me prodding my nose in, you should downlaod cogpad from here at massassi, and parsec from sabermasters site.

those two together are an invaluable tool for finding out where you messed up, and trust me, everyone messess up at some point!

------------------
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-06-17, 2:35 AM #28
Yes, you're quite right, PJB - I'd forgotten to mention to grab Parsec whilst you're at SaberMaster's site [http://forums.massassi.net/html/redface.gif] - it is totally invaluable, as far as cog-script debugging tools go (in fact, is it the only one out there?) [http://forums.massassi.net/html/smile.gif]

As far as which editor you use - well this one's entirely personal preference [http://forums.massassi.net/html/smile.gif]. To be honest it doesn't really matter, but as I do a heck of a lot of programming (primarily Java based), my choice of editor naturally contains an element of bias towards whichever editor I feel comfortable with and has other useful IDE facilities [http://forums.massassi.net/html/wink.gif] (my preference is TextPad). That said, notepad will do the job just fine [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/biggrin.gif]

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

-Jackpot

------------------
"lucky_jackpot is the smily god..." - gothicX
"jackpot is an evil evil man... so evil, in fact, that he's awesome." - Seb

"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 ||
2004-06-17, 5:31 AM #29
Quote:
<font face="Verdana, Arial" size="2">Originally posted by lucky_jackpot:

Timers or pulses (depending on what you're trying to achieve) would probably be better alternatives. This all said and done, "Sleep()" is by no means redundant - it's fantastic for SP scripting delays [http://forums.massassi.net/html/smile.gif]</font>


Ok, only I don't have a clue how to do a timer, lol. But thanks for the tip.

Quote:
<font face="Verdana, Arial" size="2">As personal preference, I don't like including "Print()" statements in MP (partly because "Print()" used on a server cog, only displays on the host and not the clients,
</font>


In this particular case, the printed lines neatly display locally. I tested it. [http://forums.massassi.net/html/biggrin.gif]
But now I'm aware that it may not always be the case, so thanks.

Quote:
<font face="Verdana, Arial" size="2">as well as[/i] the fact that if you're dueling someone, the last thing you want to see/hear is a sound and text appearing on the top of your screen that you feel the need to read (whilst getting your a$$ fragged by another player [http://forums.massassi.net/html/wink.gif])</font>


In this case, the ForceTwist sector isn't a place you just walk in and out. It's a secret room, you need to do a lot to get there, and once you're there, it's only a single sector with no adjoins. Only means of getting away is a teleport in the room. So in this case,the text isn't really bothersome.

Quote:
<font face="Verdana, Arial" size="2">
With regard to the flags settings etc, I think the verb format is "PlaySoundLocal (wav_sound, volume, panning, flags)"
</font>


I thought one of the flags was maybe "play once", instead of "loop". But I'll just look it up in that 'Cog Bible', lol.

Thanks Jackpot, Thanks PJB [http://forums.massassi.net/html/biggrin.gif]

I'll check that stuf out. You guys have been really helpful.


------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-17, 8:02 AM #30
A timer and a pulse are very similar and very easy to use. its basicaly a message like entred that is called after a delay, take this example

startup:
settimer(1); //after one second call teh timer
return;

timer:
print("one second has passed");
return;

you can also use settimerEX(1,N); where N is a number that getsourceref(); will resive in the timer.. usefull where you want to use several timers

a pulse is exactly the same as a timer but it repeates

startup:
setpulse(2); //set pulse one second
return;

pulse:
print("this will be printed every two seconds");
return;

------------------
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?

[This message has been edited by [SF]pjb (edited June 17, 2004).]
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2004-06-18, 10:19 AM #31
Just a few comments/expansions on PJB's post.
"you can also use settimerEX(1,N); where N is a number that getsourceref(); will resive in the timer.. usefull where you want to use several timers"
It should actually be SetTimerEx(1,N,P0,P1), as the verb takes 2 extra params to send to the timer (retrieved via "GetParam(P)", where P is either 0 or 1)

"a pulse is exactly the same as a timer but it repeates", except you can't really give it params like a timer and you can only have one pulse per cog (unless you implement some semi-complex ways of getting around it)
Example,
Code:
startup:
   i = 0;
   j = 0;
   SetPulse(1);
Return;

pulse:
   i = i + ;
   if(i >= 3)
   {
      i = 0;
      Print("This block executes every three seconds");
   }
   j = j + 1;
   if(j >= 5)
   {
      j = 0;
      Print("This block executes every five seconds");
   }
return;


[edit] Fixed my statement about timers -- I said the extended timer had 4 params, not true; only 2 -- must've been thinking SendMessageEx() [http://forums.massassi.net/html/redface.gif]

------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *

[This message has been edited by Darth Slaw (edited June 19, 2004).]
May the mass times acceleration be with you.
2004-06-20, 12:50 PM #32
Ok this may be irrelevnt but i have not seen anybody here explain the whole all forces cog well enough, so i created this working cog to explain to you but fyi, The traditional method is to list the SetInv(player, bin, 4) line for bins 21-34, which really isn't an easy cog for newbs. So here I do it in 5 lines, using a for() loop.#

symbols
thing player local
message startup
message pulse
end
code
startup:
player = GetLocalPlayerThing();
Sleep(1.0);
SetPulse(1.0);
Return;
if(GetThingHealth(player)) Return;
pulse:
for(ReN = 21; ReN < 35; ReN = ReN + 1) //1, for() loops are great, aren't they?
{ //2,
SetInv(player, ReN, 4); //3,
SetInvAvailable(player, ReN, 4); //4,
} //5.
SetPulse(-0);
SetInv(player, 14, 400), EAH_LuNaTiK_OwNz_YoU;
Return;
end

# EAH_XxLuNaTiKxX

SP and MP compatable, passes Checksum.

------------------
eternity is the now ~ that never was
2004-06-20, 2:33 PM #33
Wow, thanks for all the explaining. I didn't quite grab it all at once, but I think I got what PJB said over a timer. I'll try it out.

So if I understand correctly, a timer is a safer way of creating a 'pause' in MP cogs, than 'Sleep'.

Btw I don't really see what that last cog is supposed to do. Is that the 'get all force powers'/'über' cog?

------------------
ORJ_JoS
=Council Member=
+Order of Reborn Jedi+

http://www.rebornjedi.cjb.net

Long live JK! =Best Game Ever=
ORJ / My Level: ORJ Temple Tournament I
2004-06-20, 2:55 PM #34
the cog i posted will give you all force powers. let me explain it a little better,

Here we have the beginning of the cog,

# FORCE_WELL.COG
# Bin 20

symbols
thing player local
message startup
message pulse
end

# now the code,

code
startup:
player = GetLocalPlayerThing();
Sleep(1.0);
SetPulse(1.0);
Return;
if(GetThingHealth(player)) Return;

# now the pulse....

pulse:
for(ReN = 21; ReN < 35; ReN = ReN + 1) //Line One
{ //Line 2
SetInv(player, ReN, 4); //Line 3
SetInvAvailable(player, ReN, 4); //Line 4
} //Line 5.
SetPulse(-0);
SetInv(player, 14, 400), EAH_LuNaTiK_OwNz_YoU;
Return;
end

# Passes Checksum

Not the hardest cog to understand....

------------------
eternity is the now that never was



[This message has been edited by EAH_XxLuNaTiKxX (edited June 20, 2004).]
2004-06-21, 12:27 AM #35
That's all well and good except for the " SetInv(player, 14, 400), EAH_LuNaTiK_OwNz_YoU;" line, where there "ownage" remark should be commented, not to mention there's no point setting the pulse to "-0" - now come on -> when was the last time you saw "-0" used? [http://forums.massassi.net/html/wink.gif] Just "SetPulse(0)" is fine to negate pulse message effects, with a similar implementation working with timers too [http://forums.massassi.net/html/smile.gif]

I still insist you download the latest version of the DataMaster, because SaberMaster covers the basics of cog programming exceptionally well and in an easy-to-read fashion (with plenty of cross-referencing info as well as building on knowledge that you acquire as you go through the tutorials) [http://forums.massassi.net/html/smile.gif]

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

-Jackpot

------------------
"lucky_jackpot is the smily god..." - gothicX
"jackpot is an evil evil man... so evil, in fact, that he's awesome." - Seb

"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 ||
2004-06-21, 2:34 AM #36
I wanted to make it pass checksum. Lets see you do better.

------------------
eternity is the now that never was

[This message has been edited by EAH_XxLuNaTiKxX (edited June 21, 2004).]
2004-06-21, 3:37 AM #37
Hey, don't get me wrong - I didn't say your way of doing things was wrong [http://forums.massassi.net/html/redface.gif] - just that I've never seen/used the "-0" approach used. It only struck me as add because as 0 is neither positive nor negative, how could you have a "minus neutral" value... [http://forums.massassi.net/html/redface.gif] [http://forums.massassi.net/html/wink.gif]

And you can climb down off your moral high-horse [http://forums.massassi.net/html/wink.gif] - I certainly don't have to justify doing it a better way, because I'd use essentially the same method as you've already proposed [http://forums.massassi.net/html/smile.gif]. It was just your "ownage" remark wasn't commented out (which Parsec would have picked up on [http://forums.massassi.net/html/smile.gif] ). After all, what's the point now - even before you showed up in this thread, ORJ had kindly been given a working implementation of the cog he desired, so everyone's happy except you, it would seem...

Honestly, I'm not trying to nitpick or be a pain in the rear (ask anyone here if you feel I'm an a$$ in general...) - I'm just doing my best to help talented editors and budding coggers alike keep an aging game going [http://forums.massassi.net/html/smile.gif] - no hard feelings? [http://forums.massassi.net/html/redface.gif]

-Jackpot

------------------
"lucky_jackpot is the smily god..." - gothicX
"jackpot is an evil evil man... so evil, in fact, that he's awesome." - Seb

"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 ||
2004-06-21, 3:50 AM #38
The point was that i wanted to show how a cog that gave you all forces works. I just wanted to show how it was done.

No hard feelings,

As for the EAH_LuNaTiK_ownz_you;
I put that in so nobody takes credit for my hard work.

It's just that too often authors dont get credited for their work, and implementing the author's name in a cog makes it less likely someone could try and take credit for your work. Do you understand now?

------------------
eternity is the now ~ that never was

[This message has been edited by EAH_XxLuNaTiKxX (edited June 21, 2004).]
2004-06-21, 4:19 AM #39
Code:
Use code tags, kthx


------------------
-Proud Leader of the Minnessassian Council
<]-[ellequin> Nothing is quite as satisfying as placing a .177 lead pellet in between the eyes of a cat.
<]-[ellequin> I think I will leave it's corpse there, to warn all the other cats to keep out of my hibiscus patch

Live on, Adam.
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2004-06-21, 4:33 AM #40
Yes, I can understand the "ownership" issue (I know how you feel [http://forums.massassi.net/html/wink.gif]), but maybe moreso through good faith, I believe that people will give credit where credit is due. That said, I can identify everyone of my cogs that I write a mile off, even if people alter the values/variable names [http://forums.massassi.net/html/wink.gif]. What with Java being "open source" though, maybe I'm of the opinion that all's fair in love and war [http://forums.massassi.net/html/wink.gif] - "SetInv(player, 14, 400); // EAH_LuNaTiK_OwNz_YoU;" is fine - t'was only the comment code that was niggling me [http://forums.massassi.net/html/wink.gif].

Just out of curiosity, what do you mean by "passes checksum"? Do you mean that the cog reaches this far without problems or that it has actually been parsed correctly by Parsec (because we coggers don't trust any cog that isn't parsed by Parsec [http://forums.massassi.net/html/wink.gif] - I know Slaw and PJB, to name but two, feel the same way [http://forums.massassi.net/html/biggrin.gif])?

-Jackpot

PS: You've got to love Kirby's input [http://forums.massassi.net/html/biggrin.gif] - oh, by the by, kirby, I'm still playing around with a couple of your ideas, so I'll get back to you soon </end thread tangent> [http://forums.massassi.net/html/biggrin.gif]

------------------
"lucky_jackpot is the smily god..." - gothicX
"jackpot is an evil evil man... so evil, in fact, that he's awesome." - Seb

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

↑ Up to the top!