Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
First Person Shooter #205953
05/09/08 19:28
05/09/08 19:28
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Hey Guys.

I tried the whole day to make a little FPS test level / script, since I'm not motivated enough to go on with my "RPG" test / learn / (call it what ever you like) - project.

So I got the view entity's like the weapon model and the crosshair to work so far, I even managed to animate it one shot so when I press the left mouse button once and release it , the animation cycles fully until I can fire the gun again. and when I'm holding the left mouse button he fires one shot after another.

the problem is .... how the heck do I manage it to actually HIT some "bad guys"?
I tried it with some temp vectors and a trace with vec_for_screen from the crosshair to a distance anywhere in the level (20,000 quants i think).

looked like that:

VECTOR temp;
VECTOR temp2;

function shoot_trace()
{
temp.x = 399; //just for testing purposes , I'm working in window mode 800*600
temp.y = 299; //same as above
temp.z = 0;
vec_for_screen(temp, camera);
temp2.x = 399;
temp2.y = 299;
temp2.z = 20000;
vec_for_screen(temp2, camera);

c_trace(temp, temp2, IGNORE_ME | IGNORE_PASSABLE);

//From here on I don't know how to go on \:\(
}

well it does not work..
I called this function in the function that handles the shooting and animation itself. and the mentioned function is called in the player action.

I let it create a bullet hole too, (well the bullet hole's didn't align to the surface or what ever, but I tested it with ent_create("bullet_hole.tga", target, NULL); under the "//from here on I..." thing above.)
It worked. but I dont get it to work that I actually can hit an entity which dies when his health is < 0.

so please can someone give me some tipps or tutorials that handles with that in lite-c?

I despair of that

Greetz Roxas ~


PS: sry for ma bad english ~

Last edited by Roxas; 05/09/08 19:31.
Re: First Person Shooter [Re: Roxas] #205955
05/09/08 19:50
05/09/08 19:50
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
i think you would need somthing like this

c_trace(camera.x,mouse_dir3d, IGNORE_ME | IGNORE_PASSABLE);


you = ent_create("bullet_hole.tga",target.x,NULL);
vec_set(you.pan,normal.pan);


"empty"
Re: First Person Shooter [Re: flits] #205988
05/09/08 22:53
05/09/08 22:53
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
hmm I get the feeling that you missunderstood me flits ^^.
I don't want to create the bullet hole's.


My problem is, that I'm not able to shot on entity's.
So how do I manage the collision thing or what ever, that indicates that an entity was hit by my shot and looses Health?

The thing is, I've got this wonderful Arm-Model with this nice Revolver attached to it. And I want to shot something with that when I press the left mouse button. And I want that the guy dies, If i hit him often enough.

And NO I'm NOT goin' to run amok or something, I just want to learn something about shooting at something. x_x

I can't believe that this scripting language is that hard to learn isn't it?
I'm scripting 2 weeks around, and I didn't manage to get anything nice to work..
I want successes.. my motivation is about to break


But thanks for the post flits, I'll try creating the bullet hole's your way. maybe that looks good too for the beginning....

greets

Re: First Person Shooter [Re: Roxas] #206016
05/10/08 15:07
05/10/08 15:07
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

Joined: Feb 2008
Posts: 337
 Code:
VECTOR temp;
VECTOR temp2;

function shoot_trace()
{
temp.x = 399; //just for testing purposes , I'm working in window mode 800*600
temp.y = 299; //same as above
temp.z = 0;
vec_for_screen(temp, camera);
temp2.x = 399;
temp2.y = 299;
temp2.z = 20000;
vec_for_screen(temp2, camera);

c_trace(temp, temp2, IGNORE_ME | IGNORE_PASSABLE);

//From here on goes my scripting
if (you != NULL) //if we hit something, check, what's it and do stuff
{
 if (you.skill64 == 101) //to see, is it something shootable\killable
 { //in enemy's action set skill64 to 101
  you.skill1 -= 15; //if health is skill1, replace 15 by your value
 } 
}
else //if hit wall, create a hole there (btw, better to make holes dissapear
{    //after while...) thanks flits :)
 you = ent_create("bullet_hole.tga",target.x,NULL);
 vec_set(you.pan,normal.pan);
}

}

Like that?
Scripting is easy, you just need time.


I switched to other account since marth 2010. Guess which.
Re: First Person Shooter [Re: Vadim647] #206036
05/10/08 16:06
05/10/08 16:06
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
yeah it needs time, that's for sure, but the problem is that it's hard to learn it all by my own..

my problem is that i don't realy know much about lite-c or c-script and the main thing I do is trial and error, lookin in the manual, and despair of it because i don't find the right way to do it.
and then I look in the forum, search for some threads that handle with my problem, but mostly I don't find any help because it's written in c-script.

then i try to convert it to lite-c > nothing works > i'm about to freak out.

basicly im a person that realy wants to learn it, and I know that this won't happen in a few days. but it's realy annoying when I try to code something a thousand times and It does not work. I realy try hard to solve problems by myself before i post in the forum but I often get the feeling that I'm to stupid or something for coding, or are my aims just to high?

should I start with some more easier things? I want to create a nice fps or rpg. I worked with the rpg maker 2k before this and coded the most things all by myself, and it worked. but lite-c is a riddle to me.

maybe you can give me some hints and tipps for starting with lite-c to learn it?



weeeell~

Thank you Vadim it works now, got some errors first but I solved them, and know the alien dies, when I shot often enough at him.

now I got just one error with the vec_set(you.pan, normal.pan); thing, it says that pan is not a member of entity, whats wrong here?

greetz and thaaanks \:D

Re: First Person Shooter [Re: Roxas] #206041
05/10/08 16:27
05/10/08 16:27
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl

i think i dont understand you yet but i will try

actiohn emenmy()
{
my.skill1 = 100;//health
my.skill2 = 1;// i am a enemy
...

function ani()
{
wait(-0.1);
ent_remove(my);
}

function shoot_trace()
{
c_trace(camera.x,mouse_dir3d, IGNORE_ME | IGNORE_PASSABLE);
if(you != NULL)
{
if(you.skill2 == 1)
{
you.skill1 -= 10;//damage 10 every hitten shot
you = ent_create("blood.tga",target.x,ani);
vec_set(you.pan,normal.pan);
}
}
else
{
you = ent_create("bullet_hole.tga",target.x,NULL);
vec_set(you.pan,normal.pan);
}

}

action player()
{
on_key = shoot_trace;
...


"empty"
Re: First Person Shooter [Re: flits] #206047
05/10/08 16:56
05/10/08 16:56
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

Joined: Feb 2008
Posts: 337
(replace) vec_set(you.pan,normal.pan); -> vec_to_angle(you.pan,normal);


I switched to other account since marth 2010. Guess which.
Re: First Person Shooter [Re: Vadim647] #206108
05/11/08 09:33
05/11/08 09:33
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Thanks Vadim ^^
I solved that problem by my own now, but thanks anyway ^^.

I got some things to work now:
> Movement (WSAD + Mouse with camera handling for clamping the camera tilt)
> volumetric muzzle flash
> Shooting itself (and hitting someone until he dies )
> reloading (the revolver has got 6 bullets as cap | got infinit ammo so far ..)
> Animations on reload and shooting
> bullet counter that's shown on the screen (panel with digits)
> bullet hole's on walls, floor and ceiling.
> sounds (shooting and reloading)


Thanks to you guys I managed to do all this , so thank you again^^

next things I want to try:
> more weapons + changing them
> ammo pick up and "run out of ammo"-handling
> //some more things like game physics

I've got some questions and maybe you could help me with that too

1. Where can I get some free, animated arm models with weapons attached?
>like this one:




2. KI. How's the best way to code that someone's actually going to get after MY live?
>I thought about some thing with scan.. when I get in scan range of the enemy, it turns towards me, and fire's at me. but I don't even know how to start coding something like that =/


3. Is there a way to make that the View entity is affected by level lightning?
> the arm model is only affected by the lightning that flashes out, when I shot.


>>EDIT<<
One Thing I forgot !

The bullet holes are beeing aligned to the surface and all but theres one problem, somehow they begin to flicker when I move around, Is there a way to solve that?

>>EDIT END<<


If I get some other things I'll post them here too

thanks for your help so far just again \:\)

greetz Roxas~

Last edited by Roxas; 05/11/08 09:49.
Re: First Person Shooter [Re: Roxas] #206119
05/11/08 10:33
05/11/08 10:33
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
dont have time to read all currently, but about animated cool weapons:

Go some hl/cs modding site and ask authors if you can use their models in your projects(maybe you can give credits?) and import them to gs. People makse really good weapons.


3333333333
Re: First Person Shooter [Re: Quad] #206133
05/11/08 12:42
05/11/08 12:42
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
thanks for the advice, but I wasn't able to find any of this models you mentioned =/.. could you please give some example sites? I just found one site, and there were no models or resources .
Im not very familiar with counter strike or half life either.

greetz Roxas

Page 1 of 2 1 2

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