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 → Once you've jumped, it's too late!
Once you've jumped, it's too late!
2001-06-18, 6:50 AM #1
Ok, i have this cog, which whould work a parachute, but when i activate it in-game, it does nothing! Could someone loook over it an tell me if i've made any mistakes?

Code:
# Jedi Knight Cog Script
#
# item_chute.cog
#
# This is a parachute item. 
# When activated, it will slow the player's falling rate, and open up a parachute.
#
# 
# [E3 - 18/06/2001]
#

symbols

model    chute=chute.3do

Sound    chuteopen=chuteopen.wav
Sound    chuteclose=chuteclose.wav

thing    player       local

message  activated
message  deactivated
message  killed
message  pulse 
message  selected


end

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

code
activated:

SetPulse(0.5);
AttachThingToThing(chute, player);

Return;

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

deactivated:

DetachThing(chute);
DestroyThing(chute);
SetPulse(0);

Return;

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

killed:

DetachThing(chute);
DestroyThing(chute);
SetPulse(0);

Return;

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

pulse:

ApplyForce(player,VectorSet(0.0, 0.0, 50.0));

Return;

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

selected:

   jkPrintUNIString(player, 271);
   Return;


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

end


------------------
Generating Electro Vibes™ for the masses on Massassi
Go To: EL3CTROPROSE or DEEPMATRIX or The 10th Kingdom
Boba Jules: You ever read the bible TK-421?
TK-421: No?
Boba Jules: Oh, ok...
*BLAM BLAM BLAM BLAM*
Generating Electro Vibes™ for the masses on Massassi
Go To: BiTsToRm Forums or L3CY's Topsites
Boba Jules: You ever read the bible TK-421?
TK-421: No?
Boba Jules: Oh, ok...
*BLAM BLAM BLAM BLAM*
<EL3CTRO> EXCAUSE ME MISTAR CAERV BUT I LIEK MY PHORUMPHS!
2001-06-18, 10:02 AM #2
Creating the chute is a little more complicated than that. Instead of referencing a 3do, you need to make a template in static.jkl for the chute, and reference that. Then, you have to create the chute with CreateThing(). There are also some minor changes that I'm too lazy to explain. Here's the revised version:
Code:
# Jedi Knight Cog Script
#
# item_chute.cog
#
# This is a parachute item. 
# When activated, it will slow the player's falling rate, and open up a parachute.
#
# 
# [E3 - 18/06/2001]
#

symbols

template tpl_chute=chutetemplate // replace chutetemplate with whatever the name of the parachute template is.

Sound    chuteopen=chuteopen.wav
Sound    chuteclose=chuteclose.wav

thing    player       local
thing    chute        local

message  activated
message  deactivated
message  killed
message  pulse 
message  selected

vector   newvec   local
vector   scaled   local


end

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

code
activated:
chute=CreateThing(tpl_chute, player);
SetPulse(0.5);
AttachThingToThing(chute, player);

Return;

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

deactivated:

DetachThing(chute);
DestroyThing(chute);
SetPulse(0);

Return;

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

killed:

DetachThing(chute);
DestroyThing(chute);
SetPulse(0);

Return;

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

pulse:

newvec=VectorSet(0, 0, 1);
scaled=VectorScale(newvec, 150); // the second parameter is the force.
ApplyForce(player, scaled);

Return;

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

selected:

   jkPrintUNIString(player, 271);
   Return;


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

end


[This message has been edited by lordvader (edited June 18, 2001).]
Capitalization
Commas
Periods
Question Marks
Apostrophes
Confusable Words
Plague Words
2001-06-18, 11:11 AM #3
Ok, that cog isnt working [http://forums.massassi.net/html/smile.gif] I fixed up all the hot keys and they work, what happerns when i activate the cog, is that it says parachute open when i am holding the button down, and it doesnt slow me and the chute 3do doesnt appear, then when i let it go, it says parachute detached, but still nothing.

So far i have this:

Code:
# Jedi Knight Cog Script
#
# item_chute.cog
#
# This is a parachute item. 
# When activated, it will slow the player's falling rate, and open up a parachute.
#
# 
# [E3 - 18/06/2001]
#

symbols

template tpl_chute=+chute // replace chutetemplate with whatever the name of the parachute template is.

Sound    chuteopen=chuteopen.wav
Sound    chuteclose=chuteclose.wav

thing    player       local
thing    chute        local

message  activated
message  deactivated
message  killed
message  pulse 
message  selected

vector   newvec   local
vector   scaled   local


end

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

code
activated:
chute=CreateThing(tpl_chute, player);
SetPulse(0.5);
AttachThingToThing(chute, player);
Print("Parachute Open");

Return;

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

deactivated:

DetachThing(chute);
DestroyThing(chute);
SetPulse(0);
Print("Parachute Detached");

Return;

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

killed:

DetachThing(chute);
DestroyThing(chute);
SetPulse(0);

Return;

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

pulse:

newvec=VectorSet(0, 0, 1);
scaled=VectorScale(newvec, 150); // the second parameter is the force.
ApplyForce(player, scaled);

Return;

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

selected:

   jkPrintUNIString(player, 271);
   Return;


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

end


------------------
Generating Electro Vibes™ for the masses on Massassi
Go To: EL3CTROPROSE or DEEPMATRIX or The 10th Kingdom
Boba Jules: You ever read the bible TK-421?
TK-421: No?
Boba Jules: Oh, ok...
*BLAM BLAM BLAM BLAM*
Generating Electro Vibes™ for the masses on Massassi
Go To: BiTsToRm Forums or L3CY's Topsites
Boba Jules: You ever read the bible TK-421?
TK-421: No?
Boba Jules: Oh, ok...
*BLAM BLAM BLAM BLAM*
<EL3CTRO> EXCAUSE ME MISTAR CAERV BUT I LIEK MY PHORUMPHS!
2001-06-18, 4:13 PM #4
Are you sure AttachThingToThing is a valid verb? It might be but I don't recall seeing it.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-06-18, 9:27 PM #5
Here you go , I had to fix quite a few errors and mishapes , but it's done. If you find the falling being to wonky just ask and i'll smooth it out. BTW you may not know it but you have to hold down the hotkey to have it conitonly working. If you let go , it will stop and you will fall. Have fun.

Code:
# Jedi Knight Cog Script
                  #
                  # item_chute.cog
                  #
                  # This is a parachute item. 
                  # When activated, it will slow the player's falling rate, and open up a parachute.
                  #
                  # 
                  # [E3 - 18/06/2001]
                  #
                  symbols
                  template tpl_chute=+chute
                  Sound    chuteopen=chuteopen.wav
                  Sound    chuteclose=chuteclose.wav
                  thing    player       local
                  thing    chute        local
                  message  activated
                  message  deactivated
                  message  killed
                  message  pulse 
                  message  selected
                  vector   newvec   local
                  vector   scaled   local
                  end
                  # ========================================================================================
                  code
                  activated:
			player=GetLocalPlayerThing();
                  chute=CreateThing(tpl_chute, player);
                  SetPulse(0.5);
                  AttachThingToThingEx(chute, player, 0x8);
                  Return;
                  # ..................................
                  deactivated:
                  DetachThing(chute);
                  DestroyThing(chute);
                  SetPulse(0);
                  Return;
                  # ...................................
                  killed:
                  DetachThing(chute);
                  DestroyThing(chute);
                  SetPulse(0);
                  Return;
                  # ...................................
                  pulse:
			ApplyForce(player, VectorScale(VectorSub(GetThingLVec(player), '0 0 -90'), 2.0)); // force bot to jump
                  Return;
                  # ...................................
                  selected:
                     jkPrintUNIString(player, 271);
                     Return;
                  # ........................................................................................
                  end

↑ Up to the top!