lfnetwork.com mark read register faq members calendar

Thread: Script help OnNotice - TSL
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 09-12-2011, 12:08 PM   #1
newbiemodder
Gentleman Modder
 
newbiemodder's Avatar
 
Join Date: Feb 2009
Location: Chicago
Posts: 706
Veteran Modder 
Script help OnNotice - TSL

I want to have a script where a NPC will perform a certain animation if a specific creature gets close to them. Not sure how to do it or the proper syntax to use. Would I need to set up a radius around the npc and if the creature enters it, the animation is played or does this need to be OnNotice. I only want it done when the creature is practically on top or very close to him. Thanks for any help.


Who's more foolish, the fool or the fool that follows?

Just exactly what is a head-piece to the Staff of Ra?

http://www.lucasforums.com/showthread.php?t=206819

http://www.lucasforums.com/showthread.php?t=206541

http://www.lucasforums.com/showthrea...t=newbiemodder
newbiemodder is offline   you may: quote & reply,
Old 09-12-2011, 01:55 PM   #2
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
OnNotice, OnPerception, OnSight... they all work the same way, at different radius size "bubbles".

I would think that you could use a generic OnPerception script with an additional logic check to verify that which has been noticed is what you actually want noticed.

Code:
void main()
{
  int nEvent = GetUserDefinedEventNumber();   // OnPerception
  object oNoticer=GetObjectByTag();
  object oNoticed=GetObjectByTag();

  if (nEvent == 1002) && (GetObjectByTag(oNoticed) == yournoticedtag)    
  {
     AssignCommand(OBJECT_SELF, ActionPlayAnimation(x,x,x));
  }
}
This would work fine for K1, I would think it should work for TSL as well.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa

Last edited by Qui-Gon Glenn; 09-12-2011 at 02:11 PM. Reason: Nudge from Stoney
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-13-2011, 01:58 PM   #3
newbiemodder
Gentleman Modder
 
newbiemodder's Avatar
 
Join Date: Feb 2009
Location: Chicago
Posts: 706
Veteran Modder 
when compiling...it's giving me a syntax error at &&


Who's more foolish, the fool or the fool that follows?

Just exactly what is a head-piece to the Staff of Ra?

http://www.lucasforums.com/showthread.php?t=206819

http://www.lucasforums.com/showthread.php?t=206541

http://www.lucasforums.com/showthrea...t=newbiemodder
newbiemodder is offline   you may: quote & reply,
Old 09-13-2011, 09:59 PM   #4
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by newbiemodder View Post
when compiling...it's giving me a syntax error at &&
Copy that.

The issue is probably with the parens. Try several different paren situations, such as:

Code:
if ((nEvent == 1002) && (GetObjectByTag(oNoticed) == yournoticedtag))
or
Code:
if (nEvent == 1002) && (GetObjectByTag(oNoticed) == (yournoticedtag))
or
Code:
if (nEvent == 1002) && ((GetObjectByTag(oNoticed)) == (yournoticedtag))
or
Code:
if ((nEvent == 1002) && ((GetObjectByTag(oNoticed)) == (yournoticedtag)))
....

Probably the last one... sorry, not at a PC that can compile ATM

EDIT:

Code:
if ((nEvent == 1002) && (GetObjectByTag(oNoticed) == "yournoticedtag"))
will compile. Sorry about that!


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa

Last edited by Qui-Gon Glenn; 09-14-2011 at 03:47 PM. Reason: Sat down at the right PC
Qui-Gon Glenn is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Script help OnNotice - TSL

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:57 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.