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 → set "ERIAMJH" to player
set "ERIAMJH" to player
2002-12-24, 7:33 AM #1
I want to set my player flying in the air. And this func. SetPhysfl() doesn't work.

symbols

thing player local

message startup
message activated
message deactivated

keyframe fly=kysbswim.key local

end


code

activated:

player = GetLocalPlayerThing();
ls = playkey(player, fly, 1, 0x0);
SetPhysicsFlags(player, 0x2000);
SetActorExtraSpeed(player, -1.21);

Return;


deactivated:
ClearPhysicsFlags(player, 0x2000);
SetActorExtraSpeed(player, 0);
Stopkey(player, ls, 0);

Return;

end

2002-12-24, 7:53 AM #2
CODE TAGS PEOPLE!!!!!!!!!!

Like this my 'not using code tags' good sir. [http://forums.massassi.net/html/wink.gif]
Code:
# Jedi Knight Cog Script
#
# Makes actor fly when item is activated
#
# [DP]
#
symbols
message        activated
message        deactivated

int            player                        local

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

code

Activated:
   player = GetSourceRef();
   ClearPhysicsFlags(player, 0x1);
   SetPhysicsFlags(player, 0x2000);
   Return;

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

Deactivated:
   player = GetSourceRef();
   SetPhysicsFlags(player, 0x1);
   ClearPhysicsFlags(player, 0x2000);
   Return;

end
Thats the barebone basics to make the player fly. If you need more, just drop another line here. Good luck and credit me.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[edit]This will work now since I swaps GetSender for GetSource, make it as an item and like I said hold down the use key.[/edit]

[This message has been edited by Descent_pilot (edited December 26, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-12-25, 4:54 AM #3
Still nothing happend, my player don't fly. Thanks anyway. And one more question: I set to my thing in level another model (SetThingModel(victim, Ice)) and after Sleep(2.0); I want to turn it into the first stage (like Getthingmodel() [http://forums.massassi.net/html/wink.gif], but it doesn't work. If you don't understand me I can send a code here.
2002-12-25, 6:03 AM #4
Decent_Pilot's code had some small errors, try this. Add it to items.dat and setup a hot key for it.

Quote:
<font face="Verdana, Arial" size="2">
# Jedi Knight Cog Script
#
# Makes actor fly when item is activated
#
#

symbols
message activated
message killed
message startup
int player local
end

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

code

startup:
player = GetLocalPlayerThing();
return;

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

activated:
if(toggle)
{
Print("Fly: Off");
SetPhysicsFlags(player, 0x1);
ClearPhysicsFlags(player, 0x2000);
toggle = 0;
}
else
{
Print("Fly: On");
ClearPhysicsFlags(player, 0x1);
SetPhysicsFlags(player, 0x2000);
toggle = 1;
}
Return;

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

killed:
SetPhysicsFlags(player, 0x1); ClearPhysicsFlags(player, 0x2000);
toggle = 0;
Return;

end

</font>





[This message has been edited by The_New_Guy (edited December 25, 2002).]
- Wisdom is 99% experience, 1% knowledge. -
2002-12-25, 6:47 AM #5
Your forgeting the ClearPhysicsFlags(player, 0x1);. That will clear the players gravity. Clearing 0x2000 only makes the player able to maneuver in the air.
I am _ Ace_1 _ , and I approve this message.
2002-12-26, 5:53 AM #6
My version was you hold down the key. That's what I thought you wanted. My code is clean, just a different version. Also helps if I put GetSourceRef() instead. [http://forums.massassi.net/html/redface.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-12-26, 7:17 AM #7
Here is the flymode controller from the GBK tools. Note that the items.dat hotkey flags need to be set for 'player capture' for the damage control to work.

Code:
# Script for hotkey-control of flymode.
#
# GBK tools
#
# 10/2002 GBK
Symbols
Message Startup
Message Activated
Message Damaged
Thing Player			Local
Int I=0			Local
End
Code
Startup:
Sleep(0.5);
Player = JKgetlocalplayer();
Setinv(Player, 28, 1);
Stop;
Activated:
If(!I) { I=1;
Detachthing(Player);
Clearphysicsflags(Player, 0x41);
Setphysicsflags(Player, 0x2000);
Print("Flymode enabled."); }
Else { I=0;
Setphysicsflags(Player, 0x41);
Clearphysicsflags(Player, 0x2000);
Print("Flymode disabled."); }
Stop;
Damaged:
If(I==1) Returnex(0);
Else Returnex(Getparam(0));
Stop;
End
And when the moment is right, I'm gonna fly a kite.
2002-12-26, 7:20 AM #8
Thanks to all. Now it's working with func. in activated: Setgravity(0); Setphysflags(player,0x200), and in deactivated: Setgrav(3); Clearphysflags(0x2000).
2002-12-26, 7:57 AM #9
You dont need to kill the gravity. Just look at my controller. It works perfectly, without modifying the gravity.

Oh, yeah, and the gravity ingame is usually 4, not 3.
And when the moment is right, I'm gonna fly a kite.
2002-12-26, 8:56 AM #10
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Descent_pilot:
My version was you hold down the key. That's what I thought you wanted. My code is clean, just a different version. Also helps if I put GetSourceRef() instead. [http://forums.massassi.net/html/redface.gif]
</font>


Symbols section is missing an 'end' also.
- Wisdom is 99% experience, 1% knowledge. -

↑ Up to the top!