| Author |
Topic: Moving a brush by shooting a trigger |
| hereticia |
General Member Since: Jun 16, 2006 Posts: 31 Last: Apr 16, 2008 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Friday, Aug. 11, 2006 05:28 am |
 |
I asked this question in a different category and realized this is probably a better place to ask. Sorry about the double-posting.
I'm trying to get a brush to move when I shoot at a trigger.
I've got these entities:
- a script_brushmodel with targetname "brush0"
- a trigger_damage with targetname "trigger_brush0"
Here are the interesting parts of my gsc file:
Code: 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.
Any ideas? Why would I have to toss a grenade first to "wake up" the trigger? Thanks. |
 |
|
|
| ArmorMaster |
 |
General Member Since: Mar 30, 2005 Posts: 371 Last: Oct 3, 2009 [view latest posts] |
|
|
|
|
| hereticia |
General Member Since: Jun 16, 2006 Posts: 31 Last: Apr 16, 2008 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Friday, Aug. 11, 2006 06:02 am |
 |
ArmorMaster writes...Quote: Are you sure about the values? Check all your spawnflag values and check marks. In the trigger_damage look for the "pistol_no" "rifle_no" and etc... Because if it does work when you throw a nade at it then most likely it's a spawnflag problem.
Looking at my .map file, these are the only attributes for each of my entities:
"targetname" "brush0"
"classname" "script_brushmodel"
"targetname" "trigger_brush0"
"classname" "trigger_damage"
In Radiant, nothing shows up as checked. |
 |
|
|
| ArmorMaster |
 |
General Member Since: Mar 30, 2005 Posts: 371 Last: Oct 3, 2009 [view latest posts] |
|
|
|
|
| hereticia |
General Member Since: Jun 16, 2006 Posts: 31 Last: Apr 16, 2008 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Friday, Aug. 11, 2006 06:37 am |
 |
ArmorMaster writes...Quote: Is the .gsc file you posted your map's .gsc file?!
If it is, you might want to throw
maps\_load::main(); in there
Here's my gsc in its entirety:
Code: main()
{
maps\mp\_load::main();
setExpFog(0.00015, 0.15, 0.14, 0.13, 0);
ambientPlay("ambient_france");
game["allies"] = "british";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["british_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";
setcvar("r_glowbloomintensity0",".25");
setcvar("r_glowbloomintensity1",".25");
setcvar("r_glowskybleedintensity0",".3");
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;
}
|
 |
|
|
| ArmorMaster |
 |
General Member Since: Mar 30, 2005 Posts: 371 Last: Oct 3, 2009 [view latest posts] |
|
|
|
|
| sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Friday, Aug. 11, 2006 05:14 pm |
 |
I know of the issues with trigger_damage that you have. I think its a bug in the COD2 engine that would prevent the trigger from triggering if you never were close to it before. The grenade triggers correctly since the grenade itself is a entity that moves through the world and gets close to the trigger before causing damage.
Try one thing out, start the map, run to the trigger, circle it and shoot it with a rifle. THen go to the MG. I bet it will then correctly trigger. If so, then you are a victim of the bug.
I had that issue with a rifle range (and still do). You would go to the shooting pad, some yards away from the trigger, press F to start the scoring, HUD scoreboard comes up, and you could shoot all you want, the trigger would never trigger. If though you ran up to the trigger before, circled it and shot it, the shooting pad functionality worked like a charm.
I have a feeling there is a clipping behaviour in COD2 that does not add a trigger to a players list to check until he was close to it. But I still have to experiment around some more to proof that.
I have a couple thoughts to test, such as using a radius key on the trigger, rotating the trigger brush, etc. but still have to be tested.
edited on Aug. 11, 2006 01:16 pm by sentchy |
 |
|
|
| ArmorMaster |
 |
General Member Since: Mar 30, 2005 Posts: 371 Last: Oct 3, 2009 [view latest posts] |
|
|
|
|
| Skyguy |
General Member Since: Feb 8, 2006 Posts: 144 Last: Apr 25, 2009 [view latest posts] |
|
|
|
|
| sentchy |
General Member Since: May 6, 2006 Posts: 212 Last: Oct 31, 2006 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|