Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,426 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
TelePort Gun (swapping X,Y,Z coords) need help #166999
11/12/07 07:17
11/12/07 07:17
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
Basically, me and a group are working on a game for our university class this term and one of the ideas is a teleport gun where if you target certain things it lets you swap places with them. i am building this off the FPS starter kit, but im having serious issues with c_trace. What is the best way to go about this?

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167000
11/12/07 08:33
11/12/07 08:33
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
the best way would be to describe what problems EXACTLY you have with c_trace...


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: Michael_Schwarz] #167001
11/12/07 16:41
11/12/07 16:41
Joined: Nov 2007
Posts: 73
I
immolat3 Offline OP
Junior Member
immolat3  Offline OP
Junior Member
I

Joined: Nov 2007
Posts: 73
basically I have no idea how it works. i tried a few different things, for instance i was going to give all the objects you can switch with a certain texture, so i kept having c_trace check the texture of objects but no matter what i did it always returned back the texture BELOW my character, no matter if i had it c_tracing from x, y, or z.

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167002
11/12/07 19:45
11/12/07 19:45
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
If I were making such a weapon, I'd use entities and then use WED to make the objects SKILLn (where 'n' is whatever skill number you want) 9. (also arbitrary).

Then, I'd use c_trace (as I said before, use AUM 59 for reference) to trace from the weapon to 10000 quants forward. If the ray hits an object and you.skilln == 9 (i.e. a vase you placed on the floor and set its skilln to 9), store the objects position in a variable, store the players current position in a variable, then swap them.

Sure its a little more complicated than that, and if I coded it I imagine it would take me the better part of a day (so I won't ) Sorry I can't be of more help.

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

Joined: Nov 2007
Posts: 73
my problem seems to be that when i use c_trace it is tracing from below my character no matter what direction i tell it. at this point i have no weapon scripts actually in the game, i took out the base ones while i worked on things and i could add them back.

sorry im a total newb at this, heh, i wasnt suppose to be the programmer on the team but ours decided to not show up and not help us, so someone had to do it =\

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: immolat3] #167004
11/12/07 20:15
11/12/07 20:15
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
What model are you using for the player? If you made it yourself did you ensure its origin is not under its feet or something silly like that?

Also, post a snippet that contains your c_trace so people can better understand the issue.


Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: Spectre] #167005
11/12/07 20:38
11/12/07 20:38
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
Here, this may help (I took the idea from AUM 59 for you)
Code:
var TraceCoords;

on_mouse_left=TeleportGun();

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.skilln==9)
{
...put teleport stuff here
}
}



Now that is the general idea, and I *think* it may work but I didn't test it because I just don't have time (and obviously there is no teleport code there )

Good luck.

Re: TelePort Gun (swapping X,Y,Z coords) need help [Re: Spectre] #167006
11/12/07 20:42
11/12/07 20:42
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
vec_rotate(TraceCoords.x, player.pan); shouldn't that be camera.pan or ...

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

Joined: Nov 2007
Posts: 73
My function looks like:

function TeleportGun()
{
c_trace(my.x,target_pos.x,ignore_me);

if(you) // An entity was hit?
{
vec_set(temp.x,my.x); // Store position of the player
vec_set(my.x,you.x); // Setting player to hitten entity
vec_set(you.x,temp.x); // Setting you to the stored player position
}
}




and then on right mouse click im calling the function. basically nothing happens with that code, and with the code you put there i keep getting empty pointer errors when i put the teleport code in and try it.

i made the model, but the origin is in the middle and its facing the right way.

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

Joined: Nov 2007
Posts: 73
and when i use your code i get a overun error because of skilln==9

and i did set the flags to that on the object, so im not sure why

Last edited by immolat3; 11/12/07 20:59.
Page 1 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