Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,244 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[Newton] Car weapons #49288
07/16/05 22:47
07/16/05 22:47
Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
FoxZero Offline OP
Serious User
FoxZero  Offline OP
Serious User

Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
This may be a stupid question to ask, but I'd love to know. Is it possible to mount a weapon on the demo car? I've been fooling around with that code for a while, but my programing skills are weak. I just want something simple like the machine guns in Vigalante 8 or the older Twisted Metals mounted on the Pinto hood. The most complecated thing I've done was make a mini radio by pressing the m key. Is this idea possible with that code? If so where would I stat? Please don't give me offensive feedback.


Check out my site http://foxzero.net
My band's website
http://wolf-hybrid.net

R.I.P. Dave Williams
Re: [Newton] Car weapons [Re: FoxZero] #49289
07/17/05 21:37
07/17/05 21:37
Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
Marcio Esper Offline
Senior Member
Marcio Esper  Offline
Senior Member

Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
I am working with this kind of problem now.
when I solve this problem I tel you how you can do this.



First I need solve the enemy target camera problem, it change the orientation if the car change the direction.

best regards,

Marcio

Re: [Newton] Car weapons [Re: Marcio Esper] #49290
07/18/05 03:06
07/18/05 03:06
Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
FoxZero Offline OP
Serious User
FoxZero  Offline OP
Serious User

Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
Cool! Any help would bee greatly appreciated.


Check out my site http://foxzero.net
My band's website
http://wolf-hybrid.net

R.I.P. Dave Williams
Re: [Newton] Car weapons [Re: FoxZero] #49291
07/20/05 06:30
07/20/05 06:30
Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
Marcio Esper Offline
Senior Member
Marcio Esper  Offline
Senior Member

Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
I am testing here and you can use like a normal weapon in a player, but you need change the templates.

I am having problems here with the target.

I make a tower gun, like the picture, and it direction is set by bone.

when I move the mouse the tower move and the target camera move with the ang_for_bone(map_cam2.pan,torres,"arms");

But when I put this to set a bullet direction, it not work.

I think I will start again the weapon code, the actual has a lot of bugs.

best regards,

Marcio

Re: [Newton] Car weapons [Re: Marcio Esper] #49292
07/22/05 22:34
07/22/05 22:34
Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
FoxZero Offline OP
Serious User
FoxZero  Offline OP
Serious User

Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
Cool weapon. It's just like the weapon in the game Freelancer. I think that game is one of the greatest PC space games I ever played! The guns would ajust to fire where the curser was. Normal guns had limited rotating and tilting capabilities. The turrets on your ship would be able to rotate 360 degrees. When you pressed the look back button the turrets would attomaticaly swing back and you could fight off your attacker without facing him. The mouse would also simultaneously move the ship. You should definatly try something like that. It was the best targeting system ever. Good luck!

Edit: Hey cool I'm a member now!

Last edited by FoxZero; 07/22/05 22:35.

Check out my site http://foxzero.net
My band's website
http://wolf-hybrid.net

R.I.P. Dave Williams
Re: [Newton] Car weapons [Re: FoxZero] #49293
07/23/05 06:32
07/23/05 06:32
Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
Marcio Esper Offline
Senior Member
Marcio Esper  Offline
Senior Member

Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
I was played a lot freelancer, it is the best space game ever I've played

It is very cool

best regards,

Marcio

Re: [Newton] Car weapons [Re: Marcio Esper] #49294
07/25/05 11:29
07/25/05 11:29
Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
Marcio Esper Offline
Senior Member
Marcio Esper  Offline
Senior Member

Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
here is the weapon code

please if you use it, put my name in the credits.

you will ned adapt it to your needs, I have a tower gun entitie name torres, you need choose an entitie to be a gun and put the vertex of start and end the gun tuble. sorry my english is terrible.

Code:


//bullet code by Marcio Esper
//using NGD 1.51
// you need a gun entitie to set the bullet origen
//you need a bullet model
//examine the code, some things you can delet if i forget in the code


entity* projetil;

var destino[6];
var origem[6];
var final [6];
var newtonImpulseRecord[8];

function baladata(material){

var collisionType;
var body;
dll_handle = newtonHandle;

body = NewtonGetBody (my);
collisionType = my.collision_sph_box;
body = NewtonAddMapEntity (my, collisionType);
NewtonSetBodyMass (body, my.mass);
NewtonSetBodyLinearDamp (body, my.linear_drag);
NewtonSetBodyAngularDamp (body, my.angular_drag_x, my.angular_drag_y, my.angular_drag_z);
NewtonSetBodyForceAndTorque (body, ApplyGravityForceEvent);
NewtonSetBodyMaterial (body, material);
NewtonSetBodyActiveState (body, my.start_active);
vec_for_vertex(destino, torres, 130);
vec_for_vertex(origem, torres, 78);
//vec_diff (final,destino,origem); not need this


//ENT_playSOUND (torres, bum, 100); - uncoment and make a sound if you need it


// gun end of tuble point
newtonImpulseRecord[0] = destino.x;
newtonImpulseRecord[1] = destino.y;
newtonImpulseRecord[2] = destino.z;

// origin of bullet (use to determone the direction of the impulse)
newtonImpulseRecord[3] = origem.x;
newtonImpulseRecord[4] = origem.y;
newtonImpulseRecord[5] = origem.z;

// copy the bullet mass - change it to more or less distance and damage
newtonImpulseRecord[6] = 10000;

// copy the bullet speed - change like above
newtonImpulseRecord[7] = 900;
NewtonBodyAddImpulse (body, newtonImpulseRecord);

}



action bala{

projetil =me;
my.material = cores;
my.red=255;
my.green=200;
my.blue=100;
my.lightrange = 400;
my.light=on;
my.mass =10;
my.health = 20;
my.shape_factor = 0.9;
my.start_active=1;
baladata(wood_material);

}

Function tiro(){

vec_for_vertex(temp, torres, 130); //get temp the position of vertex
ent_create("balabh.mdl", temp, bala); //you need a bullet model, in this case I use balabh.mdl, you can use a little box


}



on_mouse_left = tiro();




I hope it help you.

best regards,

Marcio

Re: [Newton] Car weapons [Re: Marcio Esper] #49295
07/25/05 18:10
07/25/05 18:10
Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
FoxZero Offline OP
Serious User
FoxZero  Offline OP
Serious User

Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
Thank you so much for your code! I will definatly credit you if I put this on the net. One question though. I changed the code like you said, but I don't know what the 'cores' material is. Could you please tell me what it is so I can define it? I only know the basic of programming and very, very little about Newton.
[EDIT]: Nevermind, I figured it out.

Last edited by FoxZero; 07/25/05 18:18.

Check out my site http://foxzero.net
My band's website
http://wolf-hybrid.net

R.I.P. Dave Williams
Re: [Newton] Car weapons [Re: FoxZero] #49296
07/26/05 01:35
07/26/05 01:35
Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
Marcio Esper Offline
Senior Member
Marcio Esper  Offline
Senior Member

Joined: Sep 2002
Posts: 344
São Paulo SP Brazil
Hi,:)

The cores material it is just a material effect for the bullet, you can remove it safely.

Code:

action bala{

projetil =me;
//my.material = cores;
my.red=255;
my.green=200;
my.blue=100;
my.lightrange = 400; //it is for light, change the range to your enviroment looks bether
my.light=on;
my.mass =10;
my.health = 20;
my.shape_factor = 0.9;
my.start_active=1;
baladata(wood_material);

}



best regards,

Marcio

Re: [Newton] Car weapons [Re: Marcio Esper] #49297
07/26/05 01:40
07/26/05 01:40
Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
FoxZero Offline OP
Serious User
FoxZero  Offline OP
Serious User

Joined: Jun 2005
Posts: 1,001
Pennsylvania, USA
Thnaks. It works great!


Check out my site http://foxzero.net
My band's website
http://wolf-hybrid.net

R.I.P. Dave Williams
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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