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

Members Online

»
0 Active | 65 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Burshmodel touch trigger
Slipknot14
General Member
Since: Feb 23, 2005
Posts: 109
Last: Sep 4, 2012
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, May. 8, 2011 01:18 pm
Hello!
I want to write a script where a moving brushmodel touches a trigger, and when it touched a script start running. Is this possible?

for example
slider_tirgger waittill(slider triggered me);

thanks, creep.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Sunday, May. 8, 2011 02:13 pm
Im not sure, but maybe istouching() works for brushmodels too.

But i guess its for players only :(

So, just hard script it, and wait for it to reach a certain origin
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Sunday, May. 8, 2011 04:48 pm
it might just work. after all brush models are entities no?

so yea try something like that.

Code:

trigger = getent( value, key );
brushmodel = getent( value, key );<br />
<br />
trigger waittill( "trigger", brushmodel );


Share |
Slipknot14
General Member
Since: Feb 23, 2005
Posts: 109
Last: Sep 4, 2012
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, May. 8, 2011 06:02 pm
I'm not at home. So I can't try it, but:

trigger waittill( "trigger", brushmodel );

in this line, the 'brushmodel' is declaring a variable, and not using it :/
for example:
user iprintlnbold ("...");
user means, that 'user' declared in the waittill:
trigger waittill( "trigger", user );

it can be player and everything other too.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Sunday, May. 8, 2011 09:12 pm
voidsource writes...
Quote:

trigger = getent( value, key );
brushmodel = getent( value, key );

trigger waittill( "trigger", foo);
if(foo==brushmodel)
//do something




f'xed
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Monday, May. 9, 2011 02:32 am
foo? why not just leave it at the variable that was use for the brush, then that way we know that when the triggers gets trigged by the brushmodel then we start our actions. so i really meant was something like:
Code:

thread1()
{
trigger = getent( value, key );
brushmodel = getent( value, key );

trigger waittill( "trigger", brushmodel );

  thread do_stuff();

}


do_stuff()
{
   do stuff......

}
Share |
Spik3d
General Member
Since: Jan 30, 2008
Posts: 130
Last: Feb 19, 2015
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Monday, May. 9, 2011 03:00 am
IzNoGoD writes...
Quote:
voidsource writes...
Quote:

trigger = getent( value, key );
brushmodel = getent( value, key );

trigger waittill( "trigger", foo);
if(foo==brushmodel)
//do something




f'xed

With that, it'd only be able to be triggered once though. And if it's not the brushmodel, then it won't work afterwards.
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Monday, May. 9, 2011 03:52 am
but thats why its defined in theres in the waittill part. only if the trigger gets triggered by the brushmodel then the thread will proceed otherwise it would not. and u can always set it in the entity options as 'not player' that will trigger the trigger.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

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

»