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

Members Online

»
0 Active | 11 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Moving scriptmodel brushes help
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
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
Share |
ROTCGuy
General Member
Since: May 30, 2004
Posts: 265
Last: Mar 18, 2009
[view latest posts]
Level 5
Category: CoD2 MP Mapping
Posted: Thursday, Jun. 22, 2006 03:34 am
I would check out the elevator tutorial in the CoD mapping section.
Share |
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Thursday, Jun. 22, 2006 03:36 am
I have, but it didnt help at all. And I'm using the getting started in scrpiting (moving things) tutorial for cod1
But I cant get it to activate by using a trigger. Either the trigger is bad, or the script is bad.

Anyone else have ideas?

-Thanks,
-=MO=-Mag-DooM

PS-I'm not only going to be using this basic script for elevators. I'm going to use it for moving platforms and stuff like that. Thank you
Share |
Slipknot14
General Member
Since: Feb 23, 2005
Posts: 109
Last: Sep 4, 2012
[view latest posts]
Level 4
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);
}
}
Share |
cybershot
General Member
Since: Dec 29, 2005
Posts: 944
Last: Mar 4, 2018
[view latest posts]
Level 7
Category: CoD2 MP Mapping
Posted: Thursday, Jun. 22, 2006 05:43 am
try this script instead. i am using it for an elevator and it works great.

make a script_brushmodel. give it the targetname elevatormodel

creat a triger_use give it the targetname elevatorswitch

ad maps\mp\elevator::main(); to yourmap.gsc and put save the script below as elevator.gsc just change the height in the script to fit your needs

main() {
level.elevatorDown = true; // elevator starts at bottom: true/false
level.elevatorMoving = false; // elevator is not currently moving
thread elevator_start();
}

elevator_start() {
elevator = getentarray ("elevatorswitch","targetname");
if ( isdefined(elevator) )
for (i = 0; i < elevator.size; i++)
elevator 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 = 2;
height = 840;
wait (0);
if (level.elevatorDown) { // moves to top
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, speed);
elevatormodel waittill ("movedone");
level.elevatorDown = false;
}
else { // moves to bottom
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;
}
Share |
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
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?
Share |
hereticia
General Member
Since: Jun 16, 2006
Posts: 31
Last: Apr 16, 2008
[view latest posts]
Level 2
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?
Share |
codmp
General Member
Since: Feb 7, 2006
Posts: 905
Last: Aug 1, 2011
[view latest posts]
Level 7
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);
};
}
Share |
hereticia
General Member
Since: Jun 16, 2006
Posts: 31
Last: Apr 16, 2008
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Friday, Aug. 11, 2006 05:09 am
Forget what I said about getting different behavior when I open using devmap. But I still can't figure out why I have to throw a grenade at my trigger to get it started... ?
Share |
magdoom
General Member
Since: May 4, 2006
Posts: 172
Last: Nov 8, 2006
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Friday, Aug. 11, 2006 06:59 am
ok, not on the right computer to test it atm, but looking over the scripts, i dont see a change at all :?
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 MP Mapping

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

»