| Author |
Topic: Moving scriptmodel brushes help |
| magdoom |
General Member Since: May 4, 2006 Posts: 172 Last: Nov 8, 2006 [view latest posts] |
|
|
|
Category: CoD2 MP Mapping Posted: Thursday, Jun. 22, 2006 03:21 am |
 |
Code: main()
{
thread elevator ();
}
elevator ()
{
ele = getent ("elevator", "targetname");
eles = getent ("elevatorswitch ", "targetname");
while (1)
{
ele waittill ("eles");
ele movez (200, 5, 2, 2);
ele waittill ("eles");
ele movez (-200, 5, 2, 2);
ele waittill ("movedone");
}
}
Ok, on this script, my brush moves without waiting for my trigger. In my map i have these settings:
entity/key/value
trigger/target/elevator
trigger/targetname/elevatorswitch
scriptbrushmodel/targetname/elevator
Ok, I can get the script to stop and wait for a trigger, but the trigger that I have set to target it will not trigger the elevator, causing the script to carry out the movement. Any ideas on how I can resolve this? or am I stuck with a brush that moves back and forth nonstop?
Thanks,
-=MO=-Mag-DooM |
 |
|
|
| ROTCGuy |
General Member Since: May 30, 2004 Posts: 265 Last: Mar 18, 2009 [view latest posts] |
|
|
|
|
| magdoom |
General Member Since: May 4, 2006 Posts: 172 Last: Nov 8, 2006 [view latest posts] |
|
|
|
|
| Slipknot14 |
 |
General Member Since: Feb 23, 2005 Posts: 109 Last: Sep 4, 2012 [view latest posts] |
|
|
|
Category: CoD2 MP Mapping Posted: Thursday, Jun. 22, 2006 05:14 am |
 |
Hello, The problem is this: There isn't in script, the button's triggering, so here is the god script:
Code:
main()
{
thread elevator();
}
elevator ()
{
ele = getent ("elevator", "targetname");
eles = getent ("elevatorswitch", "targetname");
while (1)
{
eles waittill ("trigger");
ele movez (200, 5, 2, 2);
ele waittill ("movedone");
wait (2);
ele movez (-200, 5, 2, 2);
ele waittill ("movedone");
wait (2);
}
} |
 |
|
|
| cybershot |
General Member Since: Dec 29, 2005 Posts: 944 Last: Mar 4, 2018 [view latest posts] |
|
|
|
|
| magdoom |
General Member Since: May 4, 2006 Posts: 172 Last: Nov 8, 2006 [view latest posts] |
|
|
|
Category: CoD2 MP Mapping Posted: Thursday, Aug. 10, 2006 11:22 pm |
 |
Ok, I gave up on this topic for awhile and started working on alpha blending. Now im back on it and need help (my problem was never resolved)
pretty much the same as above, accept I'm useing a different script.
Code:
main()
{
thread movingplatform
}
movingplatform()
{
platform = getent ("platform","targetname");
platforms = getentarray ("platformswitch","targetname");
while (1)
{
platforms waittill ("trigger");
platform movez (600,10,4,4);
platform waittill ("movedone");
wait (2);
platforms waittill ("trigger");
platform movez (-600,10,4,4);
platform waittill ("movedone");
wait (2);
};
}
My problem is this. Either, A) the platform doesnt wait for trigger, it just keeps going up and down, or B) the platform does not move at all.
What im looking to do is pause the script here:
platforms waittill ("trigger")
and wait for the platforms to be triggered ingame.
and again at the next
platforms waittill ("trigger")
.
But I have a few questions in the meantime.
1) Is trigger a command that COD2 knows, or am I supposed to replace "trigger" with something else (like platforms... maybe redo it to [platform waittill ("platforms")]?)
2) Is there any way I can pause the script to wait for the trigger?
3)(JUST CLARIFYING THIS)-the While (1) means that it fulfills the rest of the script while the platform and platforms are set to getents that are called, correct? |
 |
|
|
| hereticia |
General Member Since: Jun 16, 2006 Posts: 31 Last: Apr 16, 2008 [view latest posts] |
|
|
|
Category: CoD2 MP Mapping Posted: Friday, Aug. 11, 2006 04:32 am |
 |
I have a similar problem - I've got these entities:
- a script_brushmodel with targetname "brush0"
- a trigger_damage with targetname "trigger_brush0"
I'm trying to get the brush to move when I shoot at the trigger. Here are the interesting parts of my gsc file:
Code:
main()
{
maps\mp\_load::main();
thread brush_control ();
}
brush_control ()
{
brush = getent ("brush0", "targetname");
trig = getent ("trigger_brush0", "targetname");
while (1) {
trig waittill ("trigger");
brush movey (-128, 2, 0.5, 0.5);
brush waittill ("movedone");
}
return;
}
The odd symptoms I am getting are:
- I have a mounted machine gun that I shoot at the trigger for a very long time and nothing happens.
- If I throw a grenade at the trigger, immediately the brush moves, then if I shoot it with the mounted gun or even my pistol, the brush will move every time. I haven't set any of the values of my trigger except for classname and targetname.
- If I use devmap to load my map instead of using "Start New Server", it works as expected without having to throw a grenade at the trigger first.
Any ideas?
|
 |
|
|
|
|
Category: CoD2 MP Mapping Posted: Friday, Aug. 11, 2006 04:42 am |
 |
@ magdoom try this
Code: main()
{
thread movingplatform
}
movingplatform()
{
platform = getent ("platform","targetname");
platforms = getentarray ("platformswitch","targetname");
while (1)
{
platforms waittill ("trigger");
platform movez (600,10,4,4);
platform waittill ("movedone");
wait (2);
platforms waittill ("trigger");
platform movez (-600,10,4,4);
platform waittill ("movedone");
wait (2);
};
}
|
 |
|
|
| hereticia |
General Member Since: Jun 16, 2006 Posts: 31 Last: Apr 16, 2008 [view latest posts] |
|
|
|
|
| magdoom |
General Member Since: May 4, 2006 Posts: 172 Last: Nov 8, 2006 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|