Black-Cell.net

  • December 17, 2018, 11:43:52 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Commands->Get_Position(GameObject *);  (Read 2028 times)

Reborn

  • Donator
  • Offline Offline
  • Posts: 200
    • View Profile
Commands->Get_Position(GameObject *);
« on: May 28, 2009, 08:11:28 AM »

I am trying to create a version of the crystal system once used in Black-Cell. I have most of it done, but I am struggling with this part here:

because of the sheer size of the crystal, the person who picks it up will not be able to enter a vehicle.  There is simply not enough room in the tiny cockpits of the vehicles to put a large crystal.  Therefore, if you enter a vehicle while holding the crystal, you will set the crystal down beside the vehicle before entering it.  If it is not picked up again in 30 seconds, it will spoil

I cannot see how this would of worked. It has to spawn at the side of the vehicle, otherwise it would be destroyed if it was spawned at the players position (picking up the crystal with a vehicle causes a tiberian explosion, as if they're ramming it).
I managed to recreate this, by getting the players position when they enter the vehicle, then increasing the x and y coordinate by like 5.0f. Making it spawn at the side. But this is obviously a really crap way of doing it. If someone got in the vehicle near the edge of the map, it could potentially make the crystal spawn in an abyss. Or say they got in the vehicle near a rock, or building, or anywhere like that really, it would be pretty glitchy.

I was thinking of spawning the crystal at the players position (so it would be under the vehicle), then setting it to not be granted for a few seconds, allowing the vehicle to drive off. Or removing the whole principle of the crystal being destroyed when a vehicle runs over it, and just respawning it...

But I am really curious as to how it was possible to write it so that it spawned to the side of the vehicle without causing a glitch now and then.

I toyed with the idea of attaching a script to the crystal holder that recorded his position every second or so, then when he entered the vehicle, spawn the crystal where he was like two seconds ago. Because at least that way you know the crystal would be spawned at a position that was valid and not inside a rock or something. But I wince at that solution.

It's not a massive deal, if no one has a clue, then i'll probably just go with the idea of setting to to not grant the power-up for a few seconds when it is spawned from entering a vehicle. But I am just really interested now in how this was done.
Logged

HeroKerr

  • Renegade Server Half-Moderator
  • Offline Offline
  • Posts: 1102
    • View Profile
Re: Commands->Get_Position(GameObject *);
« Reply #1 on: June 11, 2009, 03:00:21 PM »

Shadow-Team (used to be fnfall/gamerz0ne) have implemented this successfully. If you don't get any help here, be sure to ask Adad, I'm pretty sure he was the one who implemented it.
Logged
Not all is lost the spirits shriek
You will be hunted WE SHALL SEEK
Perserverance, turn the page
Enter Shikari Enter Shikari

♫Enter Shikari - Enter Shikari♫

Reborn

  • Donator
  • Offline Offline
  • Posts: 200
    • View Profile
Re: Commands->Get_Position(GameObject *);
« Reply #2 on: March 08, 2010, 03:34:27 PM »

Seriously, I am aware that this topic is now a bit dusty, but who cares, right?

I thought I'd bump this for Two reasons:

1)
Check this out:
http://www.commandandconquer.com/media/videos/tiberium-harvesting-video
About half way through the video you see EA reveal that they've basically made Tiberium harvesting into a Capture the crystal type deal. Sound and look familiar?
Just further proof that BC was not only the first to produce some of the coolest stuff, but did it in a manor fitting to CnC and was already way ahead of the game devs themselves.
People make all kinda of things for renegade these days, but BC did it with thought and grace.

2)
I do not believe that anyone actually solved the issue of placing the crystal by the side of the vehicle when you enter it without there being a chance of the crystal falling off the edge of the map (not unless they had a timer script attached to the soldier getting their position every few seconds, therefor a valid place to spawn the crystal if they got into a vehicle, which is pretty shitty really) .
That problem may now be solved that I can get the min and max Vector3 of the map, meaning that if I try to spawn the crystal in an out-of-bounds area, I can reselect the position programitically.
If anyone is interested, I will post that functions code.
Logged

havoc9826

  • Renegade Server Half-Moderator
  • Offline Offline
  • Posts: 907
  • Semi-Official BC Videographer
    • View Profile
    • My BC FTP Portion
Re: Commands->Get_Position(GameObject *);
« Reply #3 on: March 08, 2010, 04:50:45 PM »

Stewie's trying this now in the Atomix test server, but AFAIK he just disallowed people from entering vehicles while holding the crystal.  See if he's interested in collaborating with you on this.
Logged

Reborn

  • Donator
  • Offline Offline
  • Posts: 200
    • View Profile
Re: Commands->Get_Position(GameObject *);
« Reply #4 on: March 09, 2010, 07:58:39 AM »

I'm actually all set tbh, this was the only little niggly thing that didn't sit quite right with me, and that's sorted now. But if he needs help, then I don't mind... :-)
Logged
Pages: [1]   Go Up