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

Members Online

»
0 Active | 95 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
Category: CoDUO Mapping
CoD United Offensive mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: moving trigger
FmF-Odin
General Member
Since: Jan 13, 2010
Posts: 31
Last: Sep 16, 2010
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Monday, Mar. 22, 2010 10:03 pm
hello its me again!

Is it possible to let a trigger move?
I want to give a player a special iprintlnbold in a special moment and thought I could make a text trigger and let it move to a position when this position gets hit by mortar. when the mortar shoots an a player is in that area he should recieve a iprintlnbold that this area isn t save.

thanks in advance for helping. hope theres a way...
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Monday, Mar. 22, 2010 10:41 pm
LOL, why don't use use the move function? I am pretty sure it will work. Just use the moveto function to the mortar area. Or you don't have to use a trigger, just when the player gets hit, you can make it show up the message. Try it out.
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoDUO Mapping
Posted: Tuesday, Mar. 23, 2010 12:13 am
Or just use the distance function to see if the player is in the area that will get hit.
Share |
FmF-Odin
General Member
Since: Jan 13, 2010
Posts: 31
Last: Sep 16, 2010
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Tuesday, Mar. 23, 2010 09:11 am
ok, thank you! But i have no idea how these functions work...
moveto: let the texttrigger move?
and distance: how do i let the script che if a player is in that area?

guess I have much to learn in scripting....[ohwell]

thank you!
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoDUO Mapping
Posted: Tuesday, Mar. 23, 2010 12:47 pm
You can move stuff around using the move functions. For example:

trigger = getent(".....

trigger moveTo((12,412,21),1);

This moves the trigger entity from its current position to the coordinates in the brackets. The 1 is the time this takes - in this instance 1 second.

As for the scripted solution (which I prefer due to it not requiring an entity in the map)

Code:
warnPlayers(position)   // Call this function with the coordinates of the point that will be targeted. 
{
   radius = 300; // danger area in inches around the position

   players = getentarray("player", "classname"); // get all players in the map

   for(i = 0; i < players.size; i++) // Loop (check) through all players
   {
      if(distance(position, players[i].origin) < radius) // Measure distance from player to target position. 
      {                                                  // if distance is less than radius they get warned
         players[i] iprintlnbold("Warning! You are in the danger zone!"); // send message
      }
   }
}


When you fire your mortar you should know the coordinates of where it will land (your danger zone). Simply call the above function with the coordinates.

eg.

Code:
warnPlayers( (12,412,21) );
Share |
FmF-Odin
General Member
Since: Jan 13, 2010
Posts: 31
Last: Sep 16, 2010
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Tuesday, Mar. 23, 2010 04:39 pm
that was great help, thank you!
seems like a trigger cant be moved by the moveTo function...

have just the problem that te text should fill a room and since this distance thing mesures the distance in a "ball-area"...

but this will let me get it work.

edited on Mar. 23, 2010 12:40 pm by FmF-Odin
Share |
oppdelta
General Member
Since: Jun 3, 2007
Posts: 143
Last: Apr 27, 2011
[view latest posts]
Level 4
Category: CoDUO Mapping
Posted: Tuesday, Mar. 23, 2010 05:13 pm
You can't move triggers. BUUUUT!!! You can link them to an origin and then move them.

You have to spawn a script_origin or a script_brushmodel at the trigger's origin. Then using the linkto()


trigger enablelinkto();
wait(0.05);
trigger linkto(spawnedorigin);



Share |
FmF-Odin
General Member
Since: Jan 13, 2010
Posts: 31
Last: Sep 16, 2010
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Tuesday, Mar. 23, 2010 05:36 pm
like that?
thread movemytrigger();
}

movemytrigger()
{
trig = getent ("trigger1","targetname");
orig = getent ("origin1","targetname");

trig enablelinkto();
wait 0.05;
trig linkto(orig);

orig moveTo (x,y,z);
}


thanks for your help!
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: CoDUO Mapping
Posted: Tuesday, Mar. 23, 2010 06:37 pm
An easier method would be to simply re-define the origin of the trigger. I dont know if this works in vCOD/UO, but it works in all subsequent COD games:

Code:
movemytrigger()
{
	trig = getent( "trigger1", "targetname");

	new_origin = (X,Y,Z);
	new_angles = (X,Y,Z);
	
	trig.origin = new_origin;
	trig_angles = new_angles;
}
Share |
oppdelta
General Member
Since: Jun 3, 2007
Posts: 143
Last: Apr 27, 2011
[view latest posts]
Level 4
Category: CoDUO Mapping
Posted: Tuesday, Mar. 23, 2010 07:19 pm
I don't think it does. I tried it that way once...



And yes that should be it.


if not switch teh linto aroudn so it's


org linkto(trig);


(IF it doesn't work the other way)
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoDUO 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

»