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

Members Online

»
0 Active | 96 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 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Need help with trigger_lookat
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Monday, Feb. 24, 2014 01:18 pm
Need help to understand how to make trigger_lookat working and what things i can do with it!?

I have seen a few pages explaining how the trigger works and it only writes trigger_lookat (activates when the player looks at it)
so i tried making one to test how it works, and made a iprintlnbold in script to show me a msg, but it didn't work!
Also tried to show and hide an object, or move it, no success!

Now i need someone to explain to me how it works, and do i need to add maybe something to the script for it to work!?
Thanks for any help!
Share |
MODDER_BC
General Member
Since: Oct 17, 2012
Posts: 54
Last: Jan 30, 2015
[view latest posts]
Level 3
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 25, 2014 03:43 am
Here is an example:
Code:

look_at_me()
{
MyTrigger = getent("trigger_lookat","targetname"); //Define the trigger
MyTrigger waittill("trigger"); // Turn on the trigger
iprintln("TRIGGER LOOKED AT"); // Code to run when player looks at trigger
}
Share |
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 25, 2014 12:00 pm
Doesn't work for me!
I tried that already, and now again, still nothing!

Any other ideas? [confused]
Share |
MODDER_BC
General Member
Since: Oct 17, 2012
Posts: 54
Last: Jan 30, 2015
[view latest posts]
Level 3
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 25, 2014 04:43 pm
Everything I do with look_at trigger works for me.
You could try it this way.
Code:

look_at_actor()
{
actor = getent("price","targetname");
actor waittill_player_lookat();
iprintln("YOU SEE PRICE");
}
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: CoD4 MP Mapping
Posted: Tuesday, Feb. 25, 2014 05:00 pm
Maybe it only works in singleplayer?
Share |
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 25, 2014 06:46 pm
@MODDER BC, i get script error with thatone, unknown function waittill_player_lookat();

@3st0nian, maybe it is, but i didn't see anywhere that someone wrote it's singleplayer only!
Share |
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 25, 2014 08:38 pm
I found this now on Zeroy's script (player - islookingat)
level.player islookingat( trigger );
It doesn't say it's singleplayer only.

ZeRoY's Script

Maybe that will solve my problem, but I don't know how to make a script with it. Can you help?!
Share |
MODDER_BC
General Member
Since: Oct 17, 2012
Posts: 54
Last: Jan 30, 2015
[view latest posts]
Level 3
Category: CoD4 MP Mapping
Posted: Tuesday, Feb. 25, 2014 11:51 pm
It is Single Player only. For multiplayer your limited to the utility.gsc found in raw/maps/mp
waittill_player_lookat(); is a SP function.
Share |
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Wednesday, Feb. 26, 2014 11:45 am
Oh yes, i see that now!
Thank you MODDER_BC [thumbs_up]
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Wednesday, Feb. 26, 2014 11:54 am
Should be able to achieve this with some vector math:

Code:
vec1 = AnglesToForward( player GetPlayerAngles() );
vec2 = VectorNormalize( look_at_origin - player.origin );

if( VectorDot( vec1, vec2 ) > .996 )
{
	// Player is looking at
}
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»