lfnetwork.com mark read register faq members calendar

Thread: Syntax error
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 02-23-2009, 06:58 PM   #1
Canderis
Mercenary
 
Canderis's Avatar
 
Join Date: Jun 2008
Location: Unknown
Posts: 2,503
Current Game: Skyrim
Veteran Modder Helpful! 
Syntax error

Im trying to make this script and Im getting an error.

Code:
void main ()
object oNPC = GetObjectByTag("Tag"); 
  AssignCommand (oNPC, ChangeObjectAppearance ( object oObjectToChange, int 516 );
Any ideas?





Last edited by Canderis; 02-23-2009 at 07:08 PM.
Canderis is offline   you may: quote & reply,
Old 02-23-2009, 07:23 PM   #2
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,766
Current Game: Fallout 2
Forum Veteran Helpful! Notable contributor 
A couple things here.

You need opening an opening brace { after the void main() and a closing brace } at the end of the script.

Keep in mind that when using GetObjectByTag you will need to change "Tag" to the actual Tag string specified in the .utc file of the NPC.

You will need a similar line to declare the oObjectToChange object.

You don't need the "int" before 516.

ChangeObjectAppearance doesn't need to be embedded within an AssignCommand function. You can call it directly instead.

example:
Code:
 
void main () {
object oObjectToChange = GetObjectByTag("carth");
ChangeObjectAppearance(oObjectToChange, 516);
}


tk102 is offline   you may: quote & reply,
Old 02-23-2009, 07:52 PM   #3
Canderis
Mercenary
 
Canderis's Avatar
 
Join Date: Jun 2008
Location: Unknown
Posts: 2,503
Current Game: Skyrim
Veteran Modder Helpful! 
Thanks Tk, it worked




Canderis 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 > Syntax error

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 02:03 AM.

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