DAZZLE'S UPGRADE PACK

If you haven't already done so, upgrade your game by downloading Dazzle's all-in-one upgrade pack. It comes with everything you need for today's servers. Does your blue bar freeze when joining servers? Do you lag in games? Do you get an annoying siren in Phobik's Servers? This is what you need. CLICK HERE TO DOWNLOAD.

Script help

Modding questions, answers, help.....

Moderators: Warfare, Admin, Moderator

Post Reply
User avatar
Ice mom KT
Need Major Repair
Need Major Repair
Posts: 768
Joined: Thu Mar 19, 2009 5:32 pm
Location: Bay Area - California
Contact:

Script help

Post by Ice mom KT »

I need a few scripts for my new maze mod. I know there is a script out there that allows players to score a points by finishing a race and I can't find it. Also Ive seen the teleport script to zap people back to the start once their finished with the maze but I don't understand a bit of it. An explanation of both scripts would be greatly appreciated.
Image
User avatar
Salmon Sam
Need Major Repair
Need Major Repair
Posts: 527
Joined: Sun Aug 17, 2008 3:59 pm
Location: Oklahoma

Re: Script help

Post by Salmon Sam »

Eragon has those things. See if you can catch him on skype sometime. he'll give em to you
~poopiedoodlez 4 lyfe~
User avatar
Ice mom KT
Need Major Repair
Need Major Repair
Posts: 768
Joined: Thu Mar 19, 2009 5:32 pm
Location: Bay Area - California
Contact:

Re: Script help

Post by Ice mom KT »

Yeah he might give me the scripts but hes not bright enough to explain. The scripts don't do much good if you don't know how to use them.
Image
User avatar
LGM
Site Admin
Site Admin
Posts: 2100
Joined: Fri Dec 29, 2006 12:59 pm
Location: Very Northwest WA
Contact:

Re: Script help

Post by LGM »

That search function sure is helpful...
Dazzle (UF) wrote:Its a download dude. Jeez do we have to do everything for you guys, perhaps a little reading in the modding resource thread might just answer you questions instead of just posting question after question, how do you think any of us learnt do do these things in the first place, yes you guessed right we read the infomation that is in these and the old PTT forums!!!

Look at the Maxworks site it has LOADS of infomation:
http://www.freewebs.com/maxworks
Also
http://supra.planetthinktanks2.com/arch ... icated.asp
http://supra.planetthinktanks2.com/arch ... s-info.asp


But her you go, this is the teleport download

Teleporter Directions;

__________________________________________________________________

Step 1. The first thing you need to do is place gates reload gates using ModWiz

1a. Launch ThinkTanks and go into the map you want.

1b. Put down 2 reload gates using modwizard. 1 for where you want to enter, and one for where you want to go or any other combination you want.

1c. Save the modwiz file and exit TT. Find the mw#_#.mis file and rename as you would do normally.

1d. Open the mission file or .mis in a basic text editor of your choice.
__________________________________________________________________

Step 2. The text below is called the "function text". It can be used in pairs or apart of a sequence.

Code: Select all

//This is the 'function text"//

function 1st variable::onenter(%db, %this, %tank)
{
%pos = %tank.getPosition();
%rot = %tank.Rotation;
%newPos = ("0.000 0.000 0.000" @ " " @ %rot);
%tank.setTransform(%newPos);
}
datablock powerupdata(1st variable)
{
aipickup = 0; 
emitterduration = 0;
maxoff = 100; 
minoff = 50; 
shadow = 1; 
shadowanimation = 1;
shape = "game/data/shapes/common/recharge.dts";
starton = 0; 
staticshadow = 0; 
}; 

__________________________________________________________________

Below, is an example of a pair "function text", that can be copied and pasted to the top of the .mis file. This text should go before (or above) //--- OBJECT WRITE BEGIN ---
__________________________________________________________________

Code: Select all

//Beginning of the first pair of 'function text"//

function teleportgate1a::onenter(%db, %this, %tank)
{
%pos = %tank.getPosition();
%rot = %tank.Rotation;
%newPos = ("0.000 0.000 0.000" @ " " @ %rot);
%tank.setTransform(%newPos);
}
datablock powerupdata(teleportgate1a)
{
aipickup = 0; 
emitterduration = 0;
maxoff = 100; 
minoff = 50; 
shadow = 1; 
shadowanimation = 1;
shape = "game/data/shapes/common/recharge.dts";
starton = 0; 
staticshadow = 0; 
}; 

function teleportgate2a::onenter(%db, %this, %tank)
{
%pos = %tank.getPosition();
%rot = %tank.Rotation;
%newPos = ("0.000 0.000 0.000" @ " " @ %rot);
%tank.setTransform(%newPos);
}
datablock powerupdata(teleportgate2a)
{
aipickup = 0; 
emitterduration = 0;
maxoff = 100; 
minoff = 50; 
shadow = 1; 
shadowanimation = 1;
shape = "game/data/shapes/common/recharge.dts";
starton = 0; 
staticshadow = 0; 
}; 
//End of the first pair of 'function text"//

 //--- OBJECT WRITE BEGIN ---        <------------------------This should be below the "function text"

__________________________________________________________________

Step 3. Understand what you just did.

Notice that you just added 2 sets of the "function text" which are the same except for lines 1 and 8. (in bold)
The first copy has "Teleportgate1a" and and the second copy has "Teleportgate2a".
You can name them whatever you want as long as you can tell which ones are which. Especially if you are pairing them together. (see bottom of page)
__________________________________________________________________

Step 4. Find the reload stations you just put in.

Scroll down the mission file to where your reload gates are. They should be at the bot-tom if they were the last thing added. Prepare to edit them.
__________________________________________________________________

Step 5. Turn the the reload gates into a teleport gate.

In this step you are going to change the datablock of the reload gates to what ever you named them in the "function text" in Step 3.
Remember I used "Teleportgate1a" & "Teleportgate2a" but you can name them what ever you want.
Keep in mind that you are changing the datablocks in both the different reload gates. (see example 5a)

Change

Code: Select all

 dataBlock = "Reload";
to 
 dataBlock = "Teleportgate1a"; 
and 
 dataBlock = "Teleportgate2a"; 
respectively
_________________Example: 5a_________________

Code: Select all

 new PowerUp() {
 dataBlock = "Teleportgate1a";<-------------------------------- (Teleportgate1a  datablock)
 position = "0.100 0.100 0.100";<-------------------------------- (Teleportgate1a position)  
 rotation = "0.0 0.0 0.0 0.0";
 scale = "1 1 1";
 lightBoost = "0";
 };
 new PowerUp() {
 dataBlock = "Teleportgate2a";<-------------------------------- (Teleportgate2a datablock)
 position = "0.200 0.200 0.200";<-------------------------------- (Teleportgate2a position) 
 rotation = "0.0 0.0 0.0 0.0";
 scale = "1 1 1";
 lightBoost = "0";
// I made these positions up, you would want to c/p your position into the "function text" (see Step 6.)//
__________________________________________________________________
Step 6. Entering the positions of the gates into the "function text.

This is where people have a hard time so read carefully.
Copy and paste the position of the gate to the opposite name in the "function text".
MEANING: The position of "teleportgate1a" will be the same as the "%newPos =" of "teleportgate2a" and the position of "teleportgate2a" will be the same as the "%newPos =" of "teleportgate1a".
This is because when you go in the "teleportgate1a, you want to come out of "teleportgate2a" and when you go into "teleportgate2a" you want to come out of "teleportgate1a... right.
That's what it is called "newPos" or "new position" in the "function text".

_________________Example:_________________

Code: Select all

Function x1sectorwarp::onenter(%db, %this, %tank)<-------------------------------- (x1 datablock)
 {
 %pos = %tank.getPosition();
 %rot = %tank.Rotation;
 %newPos = ("0.200 0.200 0.200" @ " " @ %rot); <-------------------------------- (x1 position---------------->x2 position) 
 %tank.setTransform(%newPos);
 }
 datablock powerupdata(x1sectorwarp)
 {
 aipickup = 0; 
 emitterduration = 0;
 maxoff = 100; 
 minoff = 50; 
 shadow = 1; 
 shadowanimation = 1;
 shape = "game/data/shapes/common/recharge.dts";
 starton = 0; 
 staticshadow = 0; 
 }; 

Function x2sectorwarp::onenter(%db, %this, %tank) <--------------------------------(x2 datablock)
 {
 %pos = %tank.getPosition();
 %rot = %tank.Rotation;
 %newPos = ("0.100 0.100 0.100" @ " " @ %rot);<-------------------------------- (x2 position ---------------->x1 position)
 %tank.setTransform(%newPos);
 }
 datablock powerupdata(x1sectorwarp)
 {
 aipickup = 0; 
 emitterduration = 0;
 maxoff = 100; 
 minoff = 50; 
 shadow = 1; 
 shadowanimation = 1;
 shape = "game/data/shapes/common/recharge.dts";
 starton = 0; 
 staticshadow = 0; 
 }; 

//--- OBJECT WRITE BEGIN ---
__________________________________________________________________
Now you will be able to transport back and forth between the two transport gates.
Special note: If you understand what you have done, which I pray you have, then you will also realize that the transport gates don't necessarily have to go back and forth.

They can be one way tickets, x1 can go to x2 and x2 can go to x3 and x3 can go to x4 etc. Then back to x1 if you wish
x1-------->x2-------->x3-------->x4-------->xN-------->x1
Just keep track an a piece of paper how you want to map it.

__________________________________________________________________
I know the directions are kind of complicated and a little confusing. I would suggest reading it a few times.

The main thing to understand it the big picture of what you are doing.

"Two way" teloporter gates
position x1 is going to position x2 and then back again from x2 to x1
x1 ---------------> x2 ---------------> x1 ---------------> x2 ---------------> x1 --------------->x2 --------------->x1

Or

"One way" teloporter gates
position x1 is going to position x2 and then to position x3. This can go on for ever or back to x1.
x1 ---------------> x2 ---------------> x3 ---------------> x4 ---------------> x5 --------------->xn --------------->x1

If you understand this principle then the code makes more sense and you will under-stand why the variables are what they are.
00E
Need Major Repair
Need Major Repair
Posts: 1659
Joined: Sat Nov 01, 2008 8:38 am
Location: Pennsylvania
Contact:

Re: Script help

Post by 00E »

OoOohHhH... You just got burned bad, Real Bad... Good info LGM!
Has Been Playing TT Since February 18, 2004
Mods Made: 17
TT2 Supporter
User avatar
Ice mom KT
Need Major Repair
Need Major Repair
Posts: 768
Joined: Thu Mar 19, 2009 5:32 pm
Location: Bay Area - California
Contact:

Re: Script help

Post by Ice mom KT »

Yeah whatever... ^^ Ive seen all that before, thanks that's not what I needed. I need somebody to decipher that code! If I'm reading it correctly I think I need Two ammo gates named teleport1a and teleport1b. I also need a function text to make all of this work right? Correct me if I'm wrong but if I want a one way teleport I only need one ammo gate?


EDIT I still am looking for a script that gives you points like in Jerrys racing mod.
Image
User avatar
TMG Leader
Veteran Light
Veteran Light
Posts: 962
Joined: Mon Jun 25, 2007 10:31 am
Location: In my refrigerator....

Re: Script help

Post by TMG Leader »

Okay for scoring. Put this object at the end of the race.
The scripting part

Code: Select all

function score::onenter(%db, %this, %tank)
{
//blah blah blah your functions
%tank.incscore(1,1); //<<<< score function when client goes through gate or touches an object, (1,1) score amount, 1 personal and 1 team, or the other way around (I don't remember) 
}
datablock powerupdata(score)
{
aipickup = 0;
emitterduration = 0;
maxoff = 100;
minoff = 50;
shadow = 1;
shadowanimation = 1;
shape = "game/data/shapes/common/recharge.dts";
starton = 0;
staticshadow = 0;
};
 
Sometimes the %tank.incscore doesn't work, so if it doesn't, try %tank.inscore

Hope this helps.
First to fall, last man standing.
User avatar
Dazzle
Evil Site Admin
Evil Site Admin
Posts: 1320
Joined: Fri Dec 29, 2006 6:59 am
Location: London, England
Contact:

Re: Script help

Post by Dazzle »

hey Ice Mom, someone helps you with the correct information and all you can say is "Yeah whatever" !!!

What is in LGM's post is EVERY THING YOU NEED TO TELEPORT, if you cant be bothered to use your brain even a little bit then how do you expect help from others?

I was going to assist you but now I see how you are I have changed my mind. :tankermad1:
User avatar
Ice mom KT
Need Major Repair
Need Major Repair
Posts: 768
Joined: Thu Mar 19, 2009 5:32 pm
Location: Bay Area - California
Contact:

Re: Script help

Post by Ice mom KT »

All I meant was that I'd seen that page before and I didn't understand it. I didn't mean the "yeah whatever" as a way to blow it all off. In fact after looking closer and reading one of your older posts as well as LGM's I did in fact figure out how to make teleport gates work. So thanks and sorry to anyone I may have offended.
Image
Post Reply