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
4 registered members (AndrewAMD, 7th_zorro, VoroneTZ, Quad), 901 guests, and 0 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 2 of 4 1 2 3 4
Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167009
11/12/07 21:06
11/12/07 21:06
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
function TeleportGun()
{
vec_set(TraceCoords.x, vector(10000, 0, 0)); //shoots 10000 quants
vec_rotate(TraceCoords.x, player.pan); //shoots in the direction of the player
c_trace(player.x, TraceCoords.x, ignore_me | ignore_passable | activate_shoot);
if (you)
{
var tempX;
var tempY;
var tempZ;

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

my.x = TraceCoords.x;
my.y = TraceCoords.y;
my.z = TraceCoords.z;

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


i tried to do the teleport in more steps thinking it might make it easier to see for myself, but this still gives me empty pointers

i switched it to camera.pan, player.pan, and my.pan all with the same results.

Also tried switching to camera.pan and making all the my.x and such to player.x

function TeleportGun()
{
vec_set(TraceCoords.x, vector(10000, 0, 0)); //shoots 10000 quants
vec_rotate(TraceCoords.x, camera.pan); //shoots in the direction of the player
c_trace(player.x, TraceCoords.x, ignore_me | ignore_passable | activate_shoot);
if (you)
{
var tempX;
var tempY;
var tempZ;

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

player.x = TraceCoords.x;
player.y = TraceCoords.y;
player.z = TraceCoords.z;

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


this gives mea different empty pointer, it says

c_trace(player.x, TraceCoords.x, ignore_me | ignore_passable | activate_shoot);

contains the empty pointer

Last edited by immolat3; 11/12/07 21:09.
Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167010
11/12/07 21:16
11/12/07 21:16
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Maybe try setting me before c_trace:
me = player;

And maybe the player is not created yet when calling TeleportGun the first time.

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

Joined: Nov 2007
Posts: 73
Tried that, same thing, empty pointer...

var TraceCoords;

function TeleportGun()
{
me = player;
vec_set(TraceCoords.x, vector(10000, 0, 0)); //shoots 10000 quants
vec_rotate(TraceCoords.x, player.pan); //shoots in the direction of the player
c_trace(player.x, TraceCoords.x, ignore_me | ignore_passable | activate_shoot);
if (you)
{
var tempX;
var tempY;
var tempZ;

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

player.x = TraceCoords.x;
player.y = TraceCoords.y;
player.z = TraceCoords.z;

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


thats what i have, then in my input script i call TeleportGun(); obviouslly. That function is inside the actual player script, built off of the PlBiped01.wdl that comes with gamestudio a7.

vec_rotate(TraceCoords.x, player.pan);

^ that is the line causing problems at the moment.


btw, thanks so much for helping me. i appreciate it.

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

Joined: Nov 2007
Posts: 73
if(Key_Pressed(plBipedInput01_red_skill2_scancode))
{
TeleportGun();
}


incase you were wondering, but this should work fine.

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

Joined: Nov 2007
Posts: 73
im thinking it might be because

TraceCoords.x

is empty when the vec_rotate is used, but i am not sure about a lot of what you are all helping me with.

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

Joined: Nov 2007
Posts: 73
btw, i'll send whoever helps me get this working some monies through paypal, haha. not even joking, i cant even take this workload anymore, i know this is prolly easy cake for you guys, but im a web designer trying to program a video game, lol.

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167015
11/12/07 21:30
11/12/07 21:30
Joined: Mar 2005
Posts: 84
The Sacred Silence and Sleep
Spectre Offline
Junior Member
Spectre  Offline
Junior Member

Joined: Mar 2005
Posts: 84
The Sacred Silence and Sleep
Templates, eh? Don't know anything about templates. Try changing player.x and player.pan to plBiped01_entity.x and plBiped01_entity.pan

I doubt that will work but still. And to answer a previous poster on why I used PLAYER instead of CAMERA...the OP said his game was a 3rd person game (in a different thread), and thus shooting from the camera would be odd so thats why I changed it. Hell, I could still be wrong though

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167016
11/12/07 21:31
11/12/07 21:31
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
First, try that: var TraceCoords[3]; I use Lite-C so I actually don't remember how C-Script handles vectors.

Then, maybe the templates don't use "player"? Try to search in the template script s for "plBipedPlayer" or sth like that.

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

Joined: Nov 2007
Posts: 73
Well, aren't I using Lite-C at the moment? I mean, in SED the icon Says Lite-C lol.

and yea, sorry it is a third person game.

=\

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167018
11/12/07 21:37
11/12/07 21:37
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Then: VECTOR TraceCoords;

And you the return type for the function declaration, so if the function returns nothing, use void: void TeleportGun() {...} But that's only a design tip

Page 2 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