Forums Index >> Modding >> spawnsphere scripting?



Page : <1> :


I've been trying to learn a little scripting, but am stuck way out of my depth at the minute...

Wanting to make 2 scrumgoals appear, specific to each team (managed to do).
but the problem is that I don't want them as static goals, like after each goal I want them to move to another position as if they were REAL scrumgoals. And im wanting them specific to each team. Blue scrumgoal appears on blue spawnspheres and green scrumgoal appears on green spawnspheres etc.

 

Friday, March 31, 2006 at 7:27:07 PM

Easy, after a score, delete the goals and pick a random green or blue spawn respectively for the next goals.
Like so:

 

                                        
function getnewgoal(%datablock)
{
%dataGroup = "MissionGroup";
%goalCount = 0;
for(%i = 0; %i < %dataGroup.getCount(); %i++)
{
%obj = %dataGroup.getObject(%i);
if(%obj.DataBlock $= %datablock) //Make sure the %obj.DataBlock has the capitals
{
%goalCount++;
}
}
}

 

That should get you started...
while %datablock is the datablock name of the green or blue goal...

After you get how many of that particular goal there is, you can pick a random number with %goalcount as the limit, and then tell the server to go find the ramdom picked goal...

After you get all of that, simply create a new goal and viola!

 

 

 

 

Last edited: Saturday, April 22, 2006 at 10:18:11 AM

Friday, March 31, 2006 at 9:09:36 PM

^ I should add that this little snippit will not do what you want it to do, this is just a little boost in the right direction

 

 

 

 

Friday, March 31, 2006 at 9:10:24 PM

Thanks... Was what I was wanting

 

Sunday, April 02, 2006 at 8:49:44 AM

Guys... Just so you know, datablock must be DataBlock, otherwise it will be recognized as a new datablock, and an error ;)

Thursday, April 20, 2006 at 5:41:15 PM

^ um no.... Torque does not care about cases in variables... %DaTaBlOcK is the same as %datablock.... In strings however, it depends on what you are trying to do

 

 

 

 

Friday, April 21, 2006 at 4:36:03 PM

@ Warfare

If you have the time I have a easy script idea that will be valuable to the ACA or any admins. Pls e-mail me for details.

 

Last edited: Friday, April 21, 2006 at 8:05:15 PM

Friday, April 21, 2006 at 8:02:19 PM

Warfare... The part with %obj.datablock... Does give an error, until you add capitals, so it isnt recognized as a new datablock. I know, I tested this. :)

Saturday, April 22, 2006 at 8:43:21 AM

@crap
I dont have a working e-mail yet, but if you go get a membership in the red strike forum that PGG and Art started you can private message me. I intend to get an e-mail soon.... But until then :P

[edit] actually crap, if you want go ahead and e-mail me at thinktanker123@yahoo.com and pm me at the red strike forum as well... I can possibly sneak on another pc that the firewall doesnt block yahoo on.... Yeah, my father thought it suspicious of me to have a yahoo account without him knowing... Go ahead and do both and if I cant access e-mail elsewhere we can use the other forum

@canned
Sorry dude, I thought you ment the variable declared in the function

 

                                        
function getnewgoal(%datablock)

 

Yeah, the %obj.DataBlock must have the capitals or else it will whine at you... Good call. :P

 

 

 

 

Last edited: Saturday, April 22, 2006 at 10:22:01 AM

Saturday, April 22, 2006 at 10:17:09 AM

Crappy, this may be outta place... BUT GUESSWHAT... I finished the rollerball stuff without Dash. He didn't respond :(

Saturday, April 22, 2006 at 12:51:32 PM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald