Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Movement / weapon #176768
01/06/08 21:14
01/06/08 21:14
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
Hello, I have been experimenting with Lite-C since yesterday, and made this small script:


ENTITY* weap_uzi;
action speler_act()
{
weap_uzi = ent_create("mac10.mdl",vector(10,10,10),NULL);
wait(2);
weap_uzi.pan = -80;
weap_uzi.tilt = -5;
while(1)
{
camera.x = me.x;
camera.y = me.y;`
camera.z = 90;
camera.pan = me.pan;
weap_uzi.x = camera.x + 75;
weap_uzi.y = camera.y + 175;
weap_uzi.z = camera.z - 40;
if(key_w == 1)
c_move(me,vector(15*time_step,0,0),nullvector,GLIDE);
if(key_s)
c_move(me,vector(-15*time_step,0,0),nullvector,GLIDE);
if(key_d)
me.pan -= 10*time_step;
if(key_a)
me.pan += 10*time_step;
wait(1);
}
}


I have a few questions about it:

1. How can I make my mouse make the camera look up, down, left and right? (Like in shooters)
2. How can I make the player invisible (where the camera is attached to)?
3. How can I attach a weapon to the player? I have used the script like this, the weapon shows in camera just fine, but when I turn around, the gun is staying at the same position, it only floats when the player moves.

Also, I tried to make a script which enables it to pick up a gun, but I dont know what MY.EMASK value I have to use to make the player touch the gun, so the gun action runs a predifined function with is defined before...

Already have tried this:

Code:
function uzifunc(){
ent_remove(me);
weap_uzi = ent_create("mac10.mdl",vector(10,10,10),NULL);
wait(2);
weap_uzi.pan = -80;
weap_uzi.tilt = -5;
while(1){
weap_uzi.x = camera.x + 75;
weap_uzi.y = camera.y + 175;
weap_uzi.z = camera.z - 40;
}
}
action uzi(){
my.emask |= ENABLE_IMPACT;
my.event = uzifunc;
}


(Offcourse I took out the UZI script out of the main player script.)
But it looks like the function is never called...


The best games are the games you create yourself.
Re: Movement / weapon [Re: NL_3DGS_n00b] #176769
01/06/08 23:37
01/06/08 23:37
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
I'd suggest looking in your \liteC\work\earthball.c file, it has a number of things, at the bottom is the code for moving the camera, lots of other examples exist in the AUM's you should check out too. I don't have the numbers with me but several of them do what you are trying to do.


A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C
Re: Movement / weapon [Re: Trooper119] #176770
01/07/08 04:22
01/07/08 04:22
Joined: Jul 2005
Posts: 262
Earth, The Netherlands
NL_3DGS_n00b Offline OP
Member
NL_3DGS_n00b  Offline OP
Member

Joined: Jul 2005
Posts: 262
Earth, The Netherlands
Thank you for your reply.
I will look into it.


The best games are the games you create yourself.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1