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

Members Online

»
0 Active | 12 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 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
Page
Next Page
subscribe
Author Topic: Moving triggers - possible?
Zelzahim
General Member
Since: Dec 31, 2008
Posts: 42
Last: Sep 23, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 05:02 pm
Hey everyone.

Im wondering if it's possible to move a trigger_use around the map with a script since you cant make then brushmodels or anything. Im trying to make a boat to sail around in, but without a trigger it's rather useless.

Can someone help me?
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 05:14 pm
so your trying to move a trigger to make a boat go around it? why not just make the number of triggers needed into the selected areas.
I dont know if they have an option where u can turn on and off a trigger but that might be usefull for you. check on your _utility.gsc to see if theres a command like " trigger_off(); " and if theres also a "trigger_on(); ". Those will help turn them on and off. But idk if thats wat your looking for.
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 05:58 pm
well u could do something like this

trigger movez(-1000,0.1);

of corse put ur cords there and if thats not the name of trigger change that
Share |
Zelzahim
General Member
Since: Dec 31, 2008
Posts: 42
Last: Sep 23, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 06:06 pm
liltc64 writes...
Quote:
well u could do something like this

trigger movez(-1000,0.1);

of corse put ur cords there and if thats not the name of trigger change that


Yeah, that was my first thought aswell but you can't just move the trigger around since it's not a script_brushmodel.

void: i want the triggers in the "controlroom" of the boat, i want it to be able to go the way the player wants and just not between fixed positions.
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 07:05 pm
how bout linking the trigger tot he boat? im sure thats possible but i've never really linked anything b4. I have seen scripts were they do link them to one another. something like "linkto( something here ); "
Share |
3st0nian
General Member
Since: Jan 14, 2008
Posts: 291
Last: Dec 4, 2017
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 07:11 pm
Check this:
http://www.modsonline.com/Downloads-full-3626.html
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 07:56 pm
Not sure how COD2 does it, but you probably won't be able to move them using movex/y/z/to. If it is a trigger with an origin though, you can use trigger.origin = blah in a loop.

Also I don't think linkto() works with triggers.
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 08:20 pm
wat if you turn a script_origin w/ the trigger into a script_brushmodel and then link them or attached them to the boat?
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 08:33 pm
To move the trigger, just change the origin.
(Like the _utility::triggerOn())
Code:

trigger.origin = boat.origin;


You can not link a trigger to something or have something link to the trigger. I would say try something like this.

Code:

boat = getEnt("boat", "targetname"); // the boat
trig_org = getEnt("trig_org", "targetname"); // Just a script_brushmodel textured origin at the place where the trigger should be.
trigger = getEnt("trigger", "tagetname");

trigger waittill("trigger");
boat movex(50, 5);
trig_org movex(50, 5);
trigger.origin = trig_org.origin;
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jun. 26, 2009 10:16 pm
Quote:
You can not link a trigger to something or have something link to the trigger


Actually, you can if you use the enablelinkto() function. However, it isnt very efficient, so its better to delete() the trigger and then dynamically re-spawn it at the new origin.
Share |
Restricted Access Topic is Locked
Page
Next Page
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

»