Author |
Topic: Help |
coldroll |
General Member Since: Jul 5, 2006 Posts: 159 Last: Aug 24, 2007 [view latest posts] |
|
|
|
argh00 |
General Member Since: Aug 31, 2005 Posts: 138 Last: Apr 1, 2007 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Saturday, Mar. 31, 2007 07:24 pm |
|
|
|
|
|
The_Caretaker |
General Member Since: Jun 8, 2004 Posts: 11625 Last: Jul 7, 2009 [view latest posts] |
|
|
|
Marlow |
|
General Member Since: Jun 27, 2006 Posts: 150 Last: Mar 6, 2008 [view latest posts] |
|
|
|
Marlow |
|
General Member Since: Jun 27, 2006 Posts: 150 Last: Mar 6, 2008 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Wednesday, Apr. 11, 2007 12:50 am |
|
Marlow writes...Quote: That tut is ok, but where do you put the gsc, and what about the sound scripting? What sound should it call on? Where does the sound scripting go?
i followed the directions to the letter.. When I go into the map, the use icon appears, but the switch does nothing. |
|
|
|
Marlow |
|
General Member Since: Jun 27, 2006 Posts: 150 Last: Mar 6, 2008 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Wednesday, Apr. 11, 2007 01:04 am |
|
OK, I've tracked the problem down to the scripting in my gsc file... I don't know how to fit in the code suggested in the tut. Can someone help?
This is what I have that works (where and what do I put in if I followed the old COD tut for elevators?):
Code: main()
{
maps\mp\_load::main();
level thread weaponrespawner("weapons", 5);
ambientPlay("ambient_mp_msp4");
game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";
// Set some cvars
setcvar("r_glowbloomintensity0","1");
setcvar("r_glowbloomintensity1","1");
setcvar("r_glowskybleedintensity0",".5");
}
weaponrespawner(targetname, defaultrespawndelay)
{
weapons = getentarray(targetname, "targetname");
if(weapons.size > 0)
{
for(i=0; i < weapons.size; i++)
{
if(!isdefined(weapons[i].script_timescale))
weapons[i].script_timescale = defaultrespawndelay;
// kick off a thread to listen for when the item gets
picked up
weapons[i] thread
weapon_think(weapons[i].script_timescale);
}
}
}
// self = weapon reference
weapon_think(delaytime)
{
// capture important weapon data first to allow us to
respawn them
classname = self.classname;
model = self.model;
count = self.count;
org = self.origin;
angles = self.angles;
targetname = self.targetname;
// Wait till the weapon gets picked up
self waittill("trigger");
// Wait the delay before respawn
wait delaytime;
// respawn the weapon
weapon = spawn(classname, org);
weapon.angles = angles;
weapon.count = count;
weapon setmodel(model);
weapon.script_timescale = delaytime;
weapon.targetname = targetname;
// Kick off a new thread with the new weapon and kill
the old one
weapon thread weapon_think(delaytime);
}
This still doesn't resolve the sounds issue, but i'll search for topics on that. Thanks all.. |
|
|
|
Marlow |
|
General Member Since: Jun 27, 2006 Posts: 150 Last: Mar 6, 2008 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Wednesday, Apr. 11, 2007 01:39 am |
|
Sorry about the redundant posts, but I'm not allowed to edit.. At any rate, I've cleaned up what I have that works and I've also simplified what I think needs to go in.. I still can't figure out how to splice it in. Can you help?
What I have that works:
Code: main()
{
maps\mp\_load::main();
level thread weaponrespawner("weapons", 5);
ambientPlay("ambient_mp_msp4");
game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";
setcvar("r_glowbloomintensity0","1");
setcvar("r_glowbloomintensity1","1");
setcvar("r_glowskybleedintensity0",".5");
}
weaponrespawner(targetname, defaultrespawndelay)
{
weapons = getentarray(targetname, "targetname");
if(weapons.size > 0)
{
for(i=0; i < weapons.size; i++)
{
if(!isdefined(weapons[i].script_timescale))
weapons[i].script_timescale = defaultrespawndelay;
weapons[i] thread weapon_think(weapons[i].script_timescale);
}
}
}
weapon_think(delaytime)
{
classname = self.classname;
model = self.model;
count = self.count;
org = self.origin;
angles = self.angles;
targetname = self.targetname;
self waittill("trigger");
wait delaytime;
weapon = spawn(classname, org);
weapon.angles = angles;
weapon.count = count;
weapon setmodel(model);
weapon.script_timescale = delaytime;
weapon.targetname = targetname;
weapon thread weapon_think(delaytime);
}
What I need to incorporate according to the tut:
Code:
{
level.elevatorDown = true;
level.elevatorMoving = false;
thread elevator_start();
}
elevator_start()
{
elevator = getentarray ("elevatorswitch","targetname");
if ( isdefined(elevator) )
for (i = 0; i < elevator.size; i++)
elevator[i] thread elevator_think();
}
elevator_think()
{
while (1)
{
self waittill ("trigger");
if (!level.elevatorMoving)
thread elevator_move();
}
}
elevator_move()
{
elevatormodel = getent ("elevatormodel", "targetname");
level.elevatorMoving = true;
speed = 5;
height = 192;
wait (1);
if (level.elevatorDown)
{
elevatormodel playsound ("elevator1");
wait (1);
elevatormodel moveZ (height, speed);
elevatormodel waittill ("movedone");
level.elevatorDown = false;
}
else
{
elevatormodel playsound ("elevator1");
wait (1);
elevatormodel moveZ (height - (height * 2), speed);
elevatormodel waittill ("movedone");
level.elevatorDown = true;
}
level.elevatorMoving = false;
} |
|
|
|
Marlow |
|
General Member Since: Jun 27, 2006 Posts: 150 Last: Mar 6, 2008 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Wednesday, Apr. 11, 2007 03:36 am |
|
After several hours of tinkering, I've got this scripting working... What I lack in intelligence and experience, I certainly have in persistence... At any rate, here is the code that worked... I was neglecting to see that part of the code had to be grouped with the first section and the others had to stand alone...
Code: main()
{
maps\mp\_load::main();
level thread weaponrespawner("weapons", 1);
level.elevatorDown = true;
level.elevatorMoving = false;
thread elevator_start();
ambientPlay("ambient_mp_msp4");
game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";
setcvar("r_glowbloomintensity0","1");
setcvar("r_glowbloomintensity1","1");
setcvar("r_glowskybleedintensity0",".5");
}
weaponrespawner(targetname, defaultrespawndelay)
{
weapons = getentarray(targetname, "targetname");
if(weapons.size > 0)
{
for(i=0; i < weapons.size; i++)
{
if(!isdefined(weapons[i].script_timescale))
weapons[i].script_timescale = defaultrespawndelay;
weapons[i] thread
weapon_think(weapons[i].script_timescale);
}
}
}
weapon_think(delaytime)
{
classname = self.classname;
model = self.model;
count = self.count;
org = self.origin;
angles = self.angles;
targetname = self.targetname;
self waittill("trigger");
wait delaytime;
weapon = spawn(classname, org);
weapon.angles = angles;
weapon.count = count;
weapon setmodel(model);
weapon.script_timescale = delaytime;
weapon.targetname = targetname;
weapon thread weapon_think(delaytime);
}
elevator_start()
{
elevator = getentarray ("elevatorswitch","targetname");
if ( isdefined(elevator) )
for (i = 0; i < elevator.size; i++)
elevator[i] thread elevator_think();
}
elevator_think()
{
while (1)
{
self waittill ("trigger");
if (!level.elevatorMoving)
thread elevator_move();
}
}
elevator_move()
{
elevatormodel = getent ("elevatormodel", "targetname");
level.elevatorMoving = true;
speed = 5;
height = 1608;
wait (1);
if (level.elevatorDown)
{
elevatormodel playsound ("elevator1"); // sound definition for soundaliases.csv
wait (1);
elevatormodel moveZ (height, speed);
elevatormodel waittill ("movedone");
level.elevatorDown = false;
}
else
{
elevatormodel playsound ("elevator1"); // sound definition for soundaliases.csv
wait (1); // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel moveZ (height - (height * 2), speed);
elevatormodel waittill ("movedone");
level.elevatorDown = true;
}
level.elevatorMoving = false;
}
No then, here's where I'm currently stuck... I have a long elevator shaft and the elevator itself travels a long way... The trigger stays at the bottom (it is not a part of the elevator, though I wish it was). The TUT doesn't explain how to make the button part of the elevator or how to add two buttons (one at the bottom AND top). I tried two things, one long ass trigger and two triggers.. Both times the use function seemed to disappear once I got in the map.. So, how do I either attach the button, or have two buttons.. Still don't know about the sounds.
edited on Apr. 10, 2007 11:41 pm by Marlow |
|
|
|
Marlow |
|
General Member Since: Jun 27, 2006 Posts: 150 Last: Mar 6, 2008 [view latest posts] |
|
|
|
The_Caretaker |
General Member Since: Jun 8, 2004 Posts: 11625 Last: Jul 7, 2009 [view latest posts] |
|
|
|