ItsMods

Full Version: How to operate the doors ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Quote:CreateDoors(open, close, angle, size, height, hp, range)
{
level.doorwait = 0.7;
offset = (((size / 2) - 0.5) * -1);
center = spawn("script_model", open );
for(j = 0; j < size; j++){
door = spawn("script_model", open + (((0, 30, 0) * offset))*1.5, 1);
door setModel( level.crateModelFriendly );
door EnableLinkTo();
door LinkTo(center);
for(h = 1; h < height; h++){
door = spawn("script_model", open + (((0, 30, 0) * offset)*1.5) - ((55, 0, 0) * h), 1);
door setModel( level.crateModelFriendly );
door EnableLinkTo();
door LinkTo(center);
}
offset += 1;
}
center.angles = angle;
center.state = "open";
center.hp = hp;
center.range = range;
center thread DoorThink(open, close);
center thread DoorUse();
center thread ResetDoors(open, hp);
wait 0.01;
}

DoorThink(open, close)
{
while(1)
{
if(self.hp > 0){
self waittill ( "triggeruse" , player );
if(player.team == "axis"){
if(self.state == "open"){
self MoveTo(close, level.doorwait);
wait level.doorwait;
self.state = "close";
continue;
}
if(self.state == "close"){
self MoveTo(open, level.doorwait);
wait level.doorwait;
self.state = "open";
continue;
}
}
if(player.team == "allies"){
if(self.state == "close"){
self.hp--;
player iPrintlnBold("HIT");
wait 1;
continue;
}
}
} else {
if(self.state == "close"){
self MoveTo(open, level.doorwait);
}
self.state = "broken";
wait .5;
return;
}
}
}


DoorUse(range)
{
self endon("disconnect");
while(1)
{
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
if(Distance(self.origin, player.origin) <= self.range){
if(player.team == "axis"){
if(self.state == "open"){
player.hint = "Press ^3[{+activate}] ^7to ^2Close ^7the door";
}
if(self.state == "close"){
player.hint = "Press ^3[{+activate}] ^7to ^2Open ^7the door";
}
if(self.state == "broken"){
player.hint = "^1Door is Broken";
}
}
if(player.team == "allies"){
if(self.state == "close"){
player.hint = "Press ^3[{+activate}] ^7to ^2Attack ^7the door";
}
if(self.state == "broken"){
player.hint = "^1Door is Broken";
}
}
if(self UseButtonPressed()){
self notify( "triggeruse" , player);
}
}
}
wait .045;
}
}

ResetDoors(open, hp)
{
while(1)
{
level waittill("RESETDOORS");
self.hp = hp;
self MoveTo(open, level.doorwait);
self.state = "open";
}
}

How to operate the doors ? Pls
Tutorial on map bulding function coming soon....
No we have another problem i know how spawn a door but when i go next to the door i have no messages who said "press MAJ for close the door". Ours problem is when we go next to the door, the door close automaticly... (magic ??=D) we want a door who said a message =)
Sry for bad english, i learn it to school and i'm bad =D
(12-25-2010, 09:56)Grizli124 Wrote: [ -> ]No we have another problem i know how spawn a door but when i go next to the door i have no messages who said "press MAJ for close the door". Ours problem is when we go next to the door, the door close automaticly... (magic ??=D) we want a door who said a message =)
Sry for bad english, i learn it to school and i'm bad =D

thats why u need a tutorial
i made it specifically for my mods inner workings
okay ^^
(12-25-2010, 09:56)Grizli124 Wrote: [ -> ]No we have another problem i know how spawn a door but when i go next to the door i have no messages who said "press MAJ for close the door". Ours problem is when we go next to the door, the door close automaticly... (magic ??=D) we want a door who said a message =)
Sry for bad english, i learn it to school and i'm bad =D
It is an old news, you need to set a thread...
Is it "inibuttons"?
Code:
iniButtons()
{
    self endon ( "disconnect" );
    self.comboPressed = [];
    self.buttonName = [];
    self.buttonName[0]="X";
    self.buttonName[1]="Y";
    self.buttonName[2]="A";
    self.buttonName[3]="B";
    self.buttonName[4]="Up";
    self.buttonName[5]="Down";
    self.buttonName[6]="Left";
    self.buttonName[7]="Right";
    self.buttonName[8]="RT";
    self.buttonName[9]="LT";
    self.buttonName[10]="Infor";
    self.buttonAction = [];
    self.buttonAction["X"]="+activate";
    self.buttonAction["Y"]="+actionslot 1";
    self.buttonAction["A"]="+gostand";
    self.buttonAction["B"]="+melee";
    self.buttonAction["Up"]="+forward";
    self.buttonAction["Down"]="+back";
    self.buttonAction["Left"]="+actionslot 3";
    self.buttonAction["Right"]="+actionslot 4";
    self.buttonAction["RT"]="+attack";
    self.buttonAction["LT"]="+speed_throw";
    self.buttonAction["Infor"]="+actionslot 3";
            self.buttonPressed = [];
    self.update = [];
    self.update[0] = 1;
    for(i=0; i<11; i++) {
         self.buttonPressed[self.buttonName[i]] = 0;
        self thread monitorButtons( i );
    }
}
P.S: Code from MW2




you cant do that in bo anymore

So just simply remove the player team in the code first, then change the button function to the one in BO


you can do t hat, theres a few other things hes asking about

I just mean to translate the button cuz it is a unknown function in BO