Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 84 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: door script error
5rusina
General Member
Since: Jan 20, 2006
Posts: 46
Last: Nov 19, 2006
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Aug. 25, 2006 05:36 am
Ok I know i ask many question but I am still new to this.

I get popular error mesage : Script compile error .... you know the rest


Ok this is my

.gsc

Code:
#include maps\mp\_utility;



main() 
{

maps\mp\_load::main();
maps\mp\mp_testja_fx::main();

thread door1_rotate();
thread_door2_rotate();
        }
         
door1_rotate()
      {
door1 = getent("door1", "targetname");
trig = getent("door_trigger1", "targetname");
                while (1)
                    {
trig waittill("trigger");
door1 rotateyaw(90, 1.5, 0.7, 0.7);
door1 waittill"rotatedone");
               wait(3);
door1 rotateyaw(-90, 1.5, 0.7, 0.7);
door1 waittill("rotatedone");
              }
              }

              door2_rotate()              
                    {

door2 = getent("door2", "targetname");
trig = getent("door_trigger2", "targetname");
                    while (1)
                         {
trig waittill("trigger");
door2 rotateyaw(90, 1.5, 0.7, 0.7);
door2 waittill("rotatedone");
                  wait(3)
door2 rotateyaw(-90, 1.5, 0.7, 0.7);
door2 waittill("rotatedone");
                }
                }

// set background ambient noise
ambientPlay("ambient_mp_testja");
 
//Soldier Settings 
game["allies"] = "american"; 
game["axis"] = "german"; 
game["attackers"] = "allies"; 
game["defenders"] = "axis"; 
game["british_soldiertype"] = "normandy"; 
game["german_soldiertype"] = "africa";




}



everything is ok except that door script. can someone help me how can I add door2 script???

Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Friday, Aug. 25, 2006 07:17 am
The door_rotate functions should be on the bottom and your soldier settings should be inside your main function.

Like this
If this doesn't work, make sure you've got the targetnames and all right.

#include maps\mp\_utility;


main()
{

maps\mp\_load::main();
maps\mp\mp_testja_fx::main();

// set background ambient noise
ambientPlay("ambient_mp_testja");

//Soldier Settings
game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["british_soldiertype"] = "normandy";
game["german_soldiertype"] = "africa";

thread door1_rotate();
thread_door2_rotate();
}

door1_rotate()
{
door1 = getent("door1", "targetname");
trig = getent("door_trigger1", "targetname");
while (1)
{
trig waittill("trigger");
door1 rotateyaw(90, 1.5, 0.7, 0.7);
door1 waittill"rotatedone");
wait(3);
door1 rotateyaw(-90, 1.5, 0.7, 0.7);
door1 waittill("rotatedone");
}
}

door2_rotate()
{

door2 = getent("door2", "targetname");
trig = getent("door_trigger2", "targetname");
while (1)
{
trig waittill("trigger");
door2 rotateyaw(90, 1.5, 0.7, 0.7);
door2 waittill("rotatedone");
wait(3)
door2 rotateyaw(-90, 1.5, 0.7, 0.7);
door2 waittill("rotatedone");
}
}


If you get a compile error next, pull down the console by pressing shift+~. It usually gives you a bit more info about where the error is.
Share |
Big-Madman
General Member
Since: May 14, 2006
Posts: 197
Last: May 7, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Sep. 1, 2006 03:00 pm
[cool]hi guys this is not clear for me ...

question :

where > in gsc folder >>> right

do i have to put a triger over the door ????

do i have to neme that door in entity ???

can someone do a complet tuto of that ??
please ...

and may be add the sound in tuto !!!!

tx alot , apreciat all your hard work guys ..[rocking]
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Friday, Sep. 1, 2006 09:29 pm
you can put the trigger anywhere you like, as long as you give it a targetname of "door_trigger1" or 2...

You have to give the door a targetname of "door1" or 2..

There is a tutorial about moving things in the CoD section. Look it up, it explains everything.
Share |
Big-Madman
General Member
Since: May 14, 2006
Posts: 197
Last: May 7, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Sep. 14, 2006 09:45 am
[cool] Hi guys , there 's one thing i need to know , now we got the script , but the thing i want to know is what trigger i need to use for the door ???

tx [rocking]
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Thursday, Sep. 14, 2006 04:30 pm
trigger_use_touch
Share |
Big-Madman
General Member
Since: May 14, 2006
Posts: 197
Last: May 7, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Sep. 14, 2006 07:54 pm
[cool] tx The_Caretaker , i apreciate ...[thumbs_up]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»