It doesnt move because you need to script itPedsdude wrote:EDIT: I loaded the map in CoD and the camera appeared, but it didnt move and didn't have any textures.

Textures are missing because you havent extracted the files correctly (skins?)
Moderator: Core Staff
It doesnt move because you need to script itPedsdude wrote:EDIT: I loaded the map in CoD and the camera appeared, but it didnt move and didn't have any textures.
Peds ^^Drofder2004 wrote:triggers cannot be moved, but there are easy ways of detection (im guessing the trigger multiple doe the detection?
Anyway. This is my way of doing it...
Make the trigger multiple fill the entire area where the camera can see.
Then make a box out of texture "no_draw_non_solid" (found in common).
Then make the box a script_brushmodel.
Now use that brush as the detector.
Now in the scripting do...
That will make the camera detect you.Code: Select all
if(self isTouching(trigger) && self isTouching(brush)) self iprintln("you were spotted by camera");
(Nice work btw)
Aha, should have lookedDrofder2004 wrote:Peds ^^Drofder2004 wrote:triggers cannot be moved, but there are easy ways of detection (im guessing the trigger multiple doe the detection?
Anyway. This is my way of doing it...
Make the trigger multiple fill the entire area where the camera can see.
Then make a box out of texture "no_draw_non_solid" (found in common).
Then make the box a script_brushmodel.
Now use that brush as the detector.
Now in the scripting do...
That will make the camera detect you.Code: Select all
if(self isTouching(trigger) && self isTouching(brush)) self iprintln("you were spotted by camera");
(Nice work btw)
Code: Select all
main()
{
thread start();
}
Code: Select all
start()
{
start = getent("start","targetname");
brush = getent("brush","targetname");
brush thread move();
start waittill("trigger",user);
user thread hurt();
}
Code: Select all
hurt()
{
brush = getent("brush","targetname");
while(1)
{
if(self.health > 0 && self isTouching(brush))
{
if(self.health > 0)
self.health--;
wait 0.05;
}
else if(self.health < 1)
{
self suicide();
break;
}
else
break;
}
wait 0.1;
}
Code: Select all
move()
{
//Movements
}
You only need the 2 things I said...Pedsdude wrote:So I should delete the current nodraw and trigger covering the whole area, then add a brushmodel with nodraw and a trigger which starts when they enter?
Code: Select all
main()
{
ambientPlay("ambient_mp_harbor");
maps\mp\_load::main();
game["allies"] = "american";
game["axis"] = "german";
game["american_soldiertype"] = "airborne";
game["american_soldiervariation"] = "normal";
game["german_soldiertype"] = "fallschirmjagergrey";
game["german_soldiervariation"] = "normal";
game["attackers"] = "allies";
game["defenders"] = "axis";
thread Camera();
thread Camera_scope();
thread cam_trigger();
}
Camera()
{
move_camera_01 = getentarray("camera_01","targetname");
if(isdefined(move_camera_01))
{
for(i=0;i<move_camera_01.size;i++)
{
move_camera_01[i] thread do_move_camera_01();
}
}
}
Camera_scope()
{
move_camera__scope_01 = getentarray("camera_trigger_01","targetname");
if(isdefined(move_camera__scope_01))
{
for(i=0;i<move_camera__scope_01.size;i++)
{
move_camera__scope_01[i] thread do_move_camera_01();
}
}
}
do_move_camera_01()
{
while(true)
{
self rotateyaw (25, 5); //Rotate the camera to the left, with a speed of 5
self waittill ("rotatedone"); //wait untill the rotate is done, els it doesn't work
self rotateyaw (-25, 5); //Rotate the camera to the right
self waittill ("rotatedone");
self rotateyaw (-25, 5); //Rotate the camera to the right
self waittill ("rotatedone");
self rotateyaw (25, 5); //Rotate the camera to the start position
self waittill ("rotatedone");
}
}
cam_trigger()
{
cam_trig_area_01 = getent ("camera_trigger_area_01","targetname");
move_camera__scope_01 = getent("camera_trigger_01","targetname");
while(1)
{
cam_trig_area_01 waittill ("trigger",user);
if (user istouching(move_camera__scope_01))
{
user thread Camera_action();
}
wait .5;
}
}
Camera_action()
{
self iprintlnbold (self.name + " ^1the camera has spotted you!");
}
Code: Select all
main()
{
ambientPlay("ambient_mp_harbor");
maps\mp\_load::main();
game["allies"] = "american";
game["axis"] = "german";
game["american_soldiertype"] = "airborne";
game["american_soldiervariation"] = "normal";
game["german_soldiertype"] = "fallschirmjagergrey";
game["german_soldiervariation"] = "normal";
game["attackers"] = "allies";
game["defenders"] = "axis";
thread camera_think();
thread spotter_think();
thread start();
}
Code: Select all
camera_think()
{
move_camera = getentarray("camera","targetname");
if(isdefined(move_camera))
{
for(i=0;i<move_camera.size;i++)
{
move_camera[i] thread do_move_camera();
}
}
}
Code: Select all
do_move_camera();
{
while(1)
{
self rotateyaw (25, 5);
self waittill ("rotatedone");
self rotateyaw (-25, 5);
self waittill ("rotatedone");
self rotateyaw (-25, 5);
self waittill ("rotatedone");
self rotateyaw (25, 5);
self waittill ("rotatedone");
}
}
Code: Select all
spotter_think();
{
spotter = getentarray("spotter","targetname");
if(isdefined(spotter))
{
for(i=0;i<spottera.size;i++)
{
spotter[i] thread do_move_spotter();
}
}
}
Code: Select all
do_move_spotter()
{
while(1)
{
//Move Spotter (You will have to work this out)
}
}
Code: Select all
start()
{
start = getent("start","targetname");
while(1)
{
start waittill ("trigger",user);
user spotter(); //May or may not need to be threaded
}
}
Code: Select all
spotter()
{
spotter = getent("spotter","targetname");
while(1)
{
/*********************
if(self.health > 0 && self isTouching(spotter))
{
if(self.health > 0)
self.health--;
wait 0.05;
}
else if(self.health < 1)
{
self suicide();
break;
}
else
break;
*********************/
self iprintlnbold("Spotted"); // for testing purposes...
}
wait 0.1;
}
Code: Select all
move_camera = getentarray("camera","targetname");
Code: Select all
spotter_think();
{
spotter = getentarray("spotter","targetname");
if(isdefined(spotter))
{
for(i=0;i<spottera.size;i++)
{
spotter[i] thread do_move_camera();
}
}
}
Code: Select all
start()
{
start = getent("start","targetname");
spotter = getent("spotter","targetname");
while(1)
{
start waittill ("trigger",user);
if (user istouching(spotter))
user thread spotter();
}
}
Code: Select all
spotter()
{
while(1)
{
if(self.health > 0)
self.health--;
wait 0.05;
}
else if(self.health < 1)
{
self suicide();
break;
}
// else //<---Why is that?
// break; //<--And thins one.
self iprintlnbold("Spotted"); // for testing purposes...
}
wait 0.1;
}
cant remember exactly but i believe a getentarray didn't work or only partial worked.Ok, a few problems that maybe leveller can help with...
I am unsure of using an array (getentarray) for the last thread because of the "self isTouching(spotter)".
So the above code, is only currently available for one single spotter.
Users browsing this forum: No registered users and 1 guest