Innova

Innova Gameworks & Animations
Home Page Play games in the arcade * * Home Page Home Page Home Page
  Register
Login 
View unanswered posts View active topics

Delete all board cookies

Contact Us | All times are UTC - 7 hours [ DST ]



Welcome
Welcome to <strong>Innova</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!


Home Page Home Page  [ 5 posts ] 
  Print view
Previous topic | Next topic 
Author Message
Offline 
 Post subject: Respawning Objects and Spawnpoints
PostPosted: Sat Sep 26, 2009 7:28 pm 
Newbie
Newbie

Joined: Sat Aug 29, 2009 2:03 pm
Posts: 4
Ok, I am going to need a little assistance to finish my project.

1) How do I get the TNT barrels to respawn? I would like for them to respawn every 10 seconds. This is the only object that I need to respawn (everything else is fine).

2) Respawn spheres. How do I change the direction of them (that is the direction the player face when spawning)? Also, must I activate the spheres in some way for them to work or do they already work when placed onto the map?

Please help me with these two questions. If I do not make sense, let me know. With your help, I will be finished with my project!!!

-TSY


Top
 Profile  
 
Offline 
 Post subject: Re: Respawning Objects and Spawnpoints
PostPosted: Mon Sep 28, 2009 10:20 am 
User avatar
Newbie
Newbie

Joined: Sat Sep 05, 2009 1:01 pm
Posts: 6
Highscores: 17
I don't know for sure if this works the same way for tnt barrels, but I have been doing this for respawning ammo. Once you set the object in the world, go to its properties and add a new dynamic field. Call it "respawn" and set it to True. It instantly respawns the ammo though. I havn't looked into setting the respawn time to a longer duration. I'll try some things later when I'm home and see if I can find any better info for you. Might have to modify some .cs file, but no idea which it would be off the top of my head.

As for the direction of the spawn point, I think if you hold Alt while selecting either the x, y or z axis, it will allow you to rotate that. I have only done this with props like trees and houses though. Not sure if it works for player spawn spheres. If it does work at all, it probably only rotates on the y axis. Would be odd to spawn upside down or face in the dirt.

Sorry i'm probably not much help. I just remembered those things from my own experiences and thought i'd share. Maybe they will be what you need to finish.


RAD Miles Whiskey aka Travis Stroud
Computer Science Major
http://www.travisstroud.co.uk


Top
 Profile  
 
Offline 
 Post subject: Re: Respawning Objects and Spawnpoints
PostPosted: Mon Sep 28, 2009 11:14 am 
Newbie
Newbie

Joined: Sat Aug 29, 2009 2:03 pm
Posts: 4
Ok, if you can find some timing tips for the TNT barrels, that would be great. But do not stress too much about it. You have given me the basics. =)

As for the respawn spheres, I think that will do the trick. I'll post again to confirm this.

EDIT: I tried to modify both the TNT barrels and the respawn spheres, but it didn't work. It may be code that requires modifying.

If there is nothing else that can be done at this point, do not worry about it. This is just advanced stuff that could make things better.


Top
 Profile  
 
Offline 
 Post subject: Re: Respawning Objects and Spawnpoints
PostPosted: Mon Sep 28, 2009 1:50 pm 
User avatar
Innova Hero
Innova Hero

Joined: Tue May 13, 2008 9:19 pm
Posts: 156
Location: El Paso,TX
Highscores: 11
Check out this sample code I got, it talks about respawning objects, maybe you can change it up to your need(because it talks about picking up items but I don't think you want to pick up barrels, lol) and it might solve your problem....let me know what happened:

// Respawntime is the amount of time it takes for a static "auto-respawn"
// object, such as an ammo box or weapon, to re-appear after it's been
// picked up. Any item marked as "static" is automaticlly respawned.
//Hopefully zero means never.
$Item::RespawnTime = 0;//20 * 1000;

// Poptime represents how long dynamic items (those that are thrown or
// dropped) will last in the world before being deleted.
$Item::PopTime = 10 * 1000;


//-----------------------------------------------------------------------------
// ItemData base class methods used by all items
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------

function Item::respawn(%this)
{
// This method is used to respawn static ammo and weapon items
// and is usually called when the item is picked up.
// Instant fade...
%this.startFade(0, 0, true);
%this.setHidden(true);

// Shedule a reapearance
%this.schedule($Item::RespawnTime, "setHidden", false);
%this.schedule($Item::RespawnTime + 100, "startFade", 1000, 0, false);
}

function Item::schedulePop(%this)
{
// This method deletes the object after a default duration. Dynamic
// items such as thrown or drop weapons are usually popped to avoid
// world clutter.
%this.schedule($Item::PopTime - 1000, "startFade", 1000, 0, true);
%this.schedule($Item::PopTime, "delete");
}

There is also the function obj.respawn like shown in this example:

unction Upgrade::onCollision(%this,%obj,%col)
{
// Apply health to colliding object if it needs it.
// Works for all shapebase objects.
if (%col.getDamageLevel() != 0 && %col.getState() !$= "Dead" ) {
%obj.getDatablock().maxDamage =500;
%obj.respawn();
if (%col.client)
messageClient(%col.client, 'MsgHealthPatchUsed', '\c2Health Patch Applied');
serverPlay3D(HealthUseSound,%obj.getTransform());
}
}


Image


Top
 Profile  
 
Offline 
 Post subject: Re: Respawning Objects and Spawnpoints
PostPosted: Tue Sep 29, 2009 7:28 am 
Newbie
Newbie

Joined: Sat Aug 29, 2009 2:03 pm
Posts: 4
Ok, I'm lost.

Don't worry about it. I have the main project ready to go, so I will pick this up as I go.

Thank you guys for the help!

-TSY


Top
 Profile  
 
Search for:
Display posts from previous:  Sort by  
Home Page Home Page  [ 5 posts ] 

Contact Us | All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cron