Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, TipmyPip, RealSerious3D), 892 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 4 1 2 3 4
Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: Nems] #167029
11/12/07 23:03
11/12/07 23:03
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
Im pretty stuck, how hard would it be to trace for the ent_name? Like, could you show me code for say, just tracing to the model and then if it hits the model just using draw_text to say "worked" or something. my biggest issue is getting the trace to work correctly i think, if i can just get it to actually trace to the objects i need to be able to teleport with, im sure i can figure out the teleport part myself.

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167030
11/12/07 23:46
11/12/07 23:46
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
kind of big breakthrough here

function TeleportGun()
{
var theTarget;
c_trace(my.x, theTarget.x, ignore_me + scan_texture);
draw_text(tex_name,200,30,vector(100,100,255));
if(str_cmpi(tex_name, "SQUARE.MDL") == 1)
{
my.x = 100;
my.y = 100;
my.z = 100;
}
}


when i shoot the square model i have it teleports me to 100,100,100

HOWEVER, it only works if i shoot a certain side of object, i have no idea why.

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167031
11/12/07 23:55
11/12/07 23:55
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
I know this is jsut me talking to myself, but it may end up helping someone later on. I have it now so it teleports me to the object i shoot if its the right model.

function TeleportGun()
{
var theTarget;

vec_set(theTarget.x, vector(10000, 0, 0)); //shoots 10000 quants
vec_rotate(theTarget.x, my.pan); //shoots in the direction of the player
c_trace(my.x, theTarget.x, ignore_me + scan_texture); // Does the c_trace to the object

draw_text(tex_name,200,30,vector(100,100,255));

if(str_cmpi(tex_name, "SQUARE.MDL") == 1)
{
var tempX;
var tempY;
var tempZ;

tempX = your.x;
tempY = your.y;
tempZ = your.z;

my.x = tempX;
my.y = tempY;
my.z = tempZ;
}
}


however, theres still some aiming problems. it doesnt always aim right where it should, im not sure the camera pan thing is working like i thought it should.

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167032
11/13/07 00:23
11/13/07 00:23
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
works slightly better when i use the "use_box" method.

still not getting it all the time. any ideas anyone?

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167033
11/13/07 01:28
11/13/07 01:28
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
i finished! woooooooooooooooooooooooooooooo!

// Welcome to the most pain in the ass function ever!
// woooooooooooooooooooooooooooooooooo
// sankey86@gmail.com
function TeleportGun()
{
var theTarget;

vec_set(theTarget.x, vector(10000, 0, 0)); //shoots 10000 quants
vec_rotate(theTarget.x, camera.pan); //shoots in the direction of the player
c_trace(my.x, theTarget.x, ignore_me + scan_texture | ignore_passable | use_aabb ); // aabb works great here

if(str_cmpi(tex_name, "SQUARE.MDL") == 1) // if the entity hit is square.mdl
{
var tempX;
var tempY;
var tempZ;

tempX = your.x;
tempY = your.y;
tempZ = your.z;

ent_create("square.mdl", my.x, null); // Create entity at player old position

my.x = tempX; //
my.y = tempY; // Move player to old entity position
my.z = tempZ; //

if (your) // if the entity hit still exists...poof
{
ent_remove(your);
}

}
}


anyone can use that if they want, works like a charm!

Page 4 of 4 1 2 3 4

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