View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:17 am



Reply to topic  [ 7 posts ] 
 Problem setting actor team 
Author Message
User avatar

Joined: Tue Jan 12, 2010 8:25 pm
Posts: 400
Location: mukilteo, wa
Reply with quote
Post Problem setting actor team
So here's my problem.

I made a TDExplosive, that gibs a AEmitter, that emits a actor (spiderbot). When the actor comes into play it is team-less and, set to brain hunt me.

I've tried everything to get it to set the team to mine via ini, so now I'm going with Lua.
Problem is my crappy code isn't working.

Code:
function Create(self)

   SpiderBot.Team = Self.Team;  -- set team to player team

end

Its short and simple but it should work, what am I doing wrong here?

Side note: I've also tried Self.Team = Self.Team and Self.Team = 1 and Function Update(self)

Any help is much appreciated!


Sun Aug 22, 2010 8:56 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Problem setting actor team
What is this code placed in? SpiderBot doesn't seem to be defined anywhere. As well, "self" should never be capitalized.


Sun Aug 22, 2010 9:05 am
Profile WWW
User avatar

Joined: Tue Jan 12, 2010 8:25 pm
Posts: 400
Location: mukilteo, wa
Reply with quote
Post Re: Problem setting actor team
Hmmm that could account for some of my problems.

The code is placed on the actor. Should it be on the emitter?

Okay I fix the capitalization problem and, replaced spiderbot with self.
Still nothing. :oops:


I've uploaded my file, mind you this is SUPER rough. Really only a proof of concept at the moment. Actor can be bought from the bomb menu. (Ignore the gun its not finished yet either)


Sun Aug 22, 2010 9:25 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Problem setting actor team
If you wanna fix this pure-ini just use an ABomb; that is, an instantly-gibbing ACDropship with no attachments that contains the spiderbot.

It'll be on one team and not be a rogue brainhunter like most spawned clones are. You will need to force teams on the dropship, though.

For fixing it with Lua, what you should do is just use Lua to spawn the actor entirely, rather than try to change the team after spawning it. That way you can define the actor, set the team, and then spawn it.


Sun Aug 22, 2010 4:55 pm
Profile
User avatar

Joined: Tue Jan 12, 2010 8:25 pm
Posts: 400
Location: mukilteo, wa
Reply with quote
Post Re: Problem setting actor team
Thanks, I think I will try the dropship method you mentioned. What do you mean by "force teams on the dropship"? can't I just set it in the ini under Team =.... or will that just create another rouge brain hunter.


Sun Aug 22, 2010 7:54 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Problem setting actor team
Well, you can do that, and it will still function properly, but it won't be the same team as the actor if the player happens to be on the green team.


Sun Aug 22, 2010 7:57 pm
Profile
User avatar

Joined: Tue Jan 12, 2010 8:25 pm
Posts: 400
Location: mukilteo, wa
Reply with quote
Post Re: Problem setting actor team
I think I can live with that. :)

*update*

I ran into a problem using the craft method. The craft wont let me set it to bombs tab.
Ignore that I figured out how to do this using the grenade method without adding AEmitter that emits a actor.


Sun Aug 22, 2010 9:04 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.046s | 13 Queries | GZIP : Off ]