Scripting help (beginner)

Post » Wed Jun 20, 2012 3:52 pm

On this simple quest I am making, if the player says something, the npc will attack the player. So I went to the topic info, and put in the end section:
StartCombat(Game.GetPlayer())
but an error message pops up that says
Compiling "TIF__0100FB43"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0100FB43.psc(9,0): StartCombat is not a function or does not exist
No output generated for TIF__0100FB43, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__0100FB43

Should be just a nooby mistake, but help is appreciated.
User avatar
Rebecca Dosch
 
Posts: 3453
Joined: Thu Jan 18, 2007 6:39 pm

Post » Wed Jun 20, 2012 11:20 am

you need to put a reference in front of it, who is supposed to to the attacking.
As it stands, since the script it attached to the quest, your saying the quest needs to attack the player.

So, attach an Actorbase property to your script, pointing to your NPC who is going to attack. Then put that reference property name in front of the startcombat function like so:

myQuestNPC.StartCombat(Game.GetPlayer())
User avatar
Robert Devlin
 
Posts: 3521
Joined: Mon Jul 23, 2007 2:19 pm

Post » Wed Jun 20, 2012 1:43 pm

So where should I attach the actorbase property? On the TIF one, or should I make my own scipt?
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Wed Jun 20, 2012 9:23 am

create a property and set in from the edit button in the properties window
User avatar
Liv Brown
 
Posts: 3358
Joined: Wed Jan 31, 2007 11:44 pm

Post » Wed Jun 20, 2012 9:13 am

create a property and set in from the edit button in the properties window
So I go on the TIF script click on properties, Add a property, actorbase, name it what my actor is? And what do I put for Initial Value?
User avatar
Kate Schofield
 
Posts: 3556
Joined: Mon Sep 18, 2006 11:58 am

Post » Wed Jun 20, 2012 1:41 pm

You could probably also use actor or objectreference. You just need to point to the NPC that you want to perform the combat.

ActorBase will require the NPC's base name.
User avatar
Neliel Kudoh
 
Posts: 3348
Joined: Thu Oct 26, 2006 2:39 am

Post » Wed Jun 20, 2012 11:51 am

Starting 1 compile threads for 1 files...
Compiling "TIF__0100FB43"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\TIF__0100FB43.psc(2,0): missing SCRIPTNAME at 'ActorBase'
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\TIF__0100FB43.psc(2,10): required (...)+ loop did not match anything at input 'Property'
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\TIF__0100FB43.psc(2,32): mismatched input '\\r\\n' expecting STATE
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\TIF__0100FB43.psc(7,0): missing EOF at 'Scriptname'
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\TIF__0100FB43.psc(0,0): filename does not match script name: actorbase
No output generated for TIF__0100FB43, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__0100FB43

This happens when I try to add an actorbase property on the TIF script.
User avatar
Rhysa Hughes
 
Posts: 3438
Joined: Thu Nov 23, 2006 3:00 pm

Post » Wed Jun 20, 2012 12:48 pm

The error messages don't tell us much without the accompanying script.

Did you rename your script "Actorbase?" If this is a fragment, you don't put a "Scriptname" line in it.

what you need is something like:

ObjectReference Property HomicidalManiac AutoHomicidalManiac.StartCombat(Game.GetPlayer())

And assign "HomicidalManiac" property to the actor you want to attack the player in the Properties dialog.
User avatar
Christine Pane
 
Posts: 3306
Joined: Mon Apr 23, 2007 2:14 am

Post » Wed Jun 20, 2012 9:02 am

The error messages don't tell us much without the accompanying script.

Did you rename your script "Actorbase?" If this is a fragment, you don't put a "Scriptname" line in it.

what you need is something like:

ObjectReference Property HomicidalManiac AutoHomicidalManiac.StartCombat(Game.GetPlayer())

And assign "HomicidalManiac" property to the actor you want to attack the player in the Properties dialog.
Wait should I make a new script? Not use the TIF one? So I create a new script called actor base, then make a new property called actorbase?
User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm

Post » Wed Jun 20, 2012 5:42 am

You need a reference in front of that. You can make a property and then define it inside your event. Make sure you open the properties window and make the "Murderer" value to whatever actor you want him to be. You won't need to pre-define "aPlayer" though. So It would be like this:

Scriptname TEST Extends WhateverObjectReference Property Murderer AutoObjectReference Property aPlayer AutoEvent OnSomeEvent()	aPlayer = Game.GetPlayer()			Murderer.StartCombat(aPlayer)EndEvent
User avatar
NeverStopThe
 
Posts: 3405
Joined: Tue Mar 27, 2007 11:25 pm

Post » Wed Jun 20, 2012 5:03 am

You need a reference in front of that. You can make a property and then define it inside your event. So It would be like this:

Scriptname TEST Extends WhateverObjectReference Property Murderer AutoObjectReference Property aPlayer AutoOnSomeEvent()aPlayer = Game.GetPlayer()Murderer.StartCombat(aPlayer)EndEvent
I am using the end script though, like once they stop talking he attacks, how can I do that.
User avatar
Lauren Graves
 
Posts: 3343
Joined: Fri Aug 04, 2006 6:03 pm

Post » Wed Jun 20, 2012 2:01 pm

I am using the end script though, like once they stop talking he attacks, how can I do that.

Can you explain this better I don't understand...
User avatar
Thomas LEON
 
Posts: 3420
Joined: Mon Nov 26, 2007 8:01 am

Post » Wed Jun 20, 2012 1:03 pm

Can you explain this better I don't understand...
Apologies. My character in this questline is saying something that initiates combat with the other character. So I went to the dialogue views topic info, and in the end script, I'm going to put GSQTulys.StartCombat(Game.GetPlayer()) but when I do that this comes up.

Starting 1 compile threads for 1 files...
Compiling "TIF__010100AA"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(9,0): variable GSQTulys is undefined
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(9,9): none is not a known user-defined type
No output generated for TIF__010100AA, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__010100AA
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am

Post » Wed Jun 20, 2012 4:19 am

So "GSQTulys" is a quest alias? Change it to Alias_GSQTulys.GetRef() in your script.
User avatar
michael flanigan
 
Posts: 3449
Joined: Thu Jun 14, 2007 2:33 pm

Post » Wed Jun 20, 2012 8:30 am

So "GSQTulys" is a quest alias? Change it to Alias_GSQTulys.GetRef() in your script.
So I should have it as?
Alias_GSQTulys.GetRef()
GSQTulys.StartCombat(Game.GetPlayer())
User avatar
Luis Reyma
 
Posts: 3361
Joined: Fri Nov 02, 2007 11:10 am

Post » Wed Jun 20, 2012 1:46 pm

So I should have it as?
Alias_GSQTulys.GetRef()
GSQTulys.StartCombat(Game.GetPlayer())

All in one line, like this:

Alias_GSQTulys.GetRef().StartCombat(Game.GetPlayer())
User avatar
A Lo RIkIton'ton
 
Posts: 3404
Joined: Tue Aug 21, 2007 7:22 pm

Post » Wed Jun 20, 2012 3:08 am

Did that. Same message :/
Starting 1 compile threads for 1 files...
Compiling "TIF__010100AA"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(9,0): variable Alias_GSQTulys is undefined
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(9,15): none is not a known user-defined type
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(9,24): none is not a known user-defined type
No output generated for TIF__010100AA, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__010100AA
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am

Post » Wed Jun 20, 2012 1:11 pm

Looks like you did not attach a property in the script to point to the quest in-game.
User avatar
Jose ordaz
 
Posts: 3552
Joined: Mon Aug 27, 2007 10:14 pm

Post » Wed Jun 20, 2012 9:45 am

Looks like you did not attach a property in the script to point to the quest in-game.
How can I do this?
User avatar
Rodney C
 
Posts: 3520
Joined: Sat Aug 18, 2007 12:54 am

Post » Wed Jun 20, 2012 2:27 am

How can I do this?

Properties > New Property > Quest
User avatar
Jonathan Egan
 
Posts: 3432
Joined: Fri Jun 22, 2007 3:27 pm

Post » Wed Jun 20, 2012 5:15 am

Please post your actual script here, because its hard to understand what the issue is if we can't see it

Use CODE tags (it's the little S icon in the reply message thing)
User avatar
Hannah Whitlock
 
Posts: 3485
Joined: Sat Oct 07, 2006 12:21 am

Post » Wed Jun 20, 2012 3:59 am

Ok exact script. (On the dialogue topic info, in the end section of the script.)
Alias_GSQTulys.GetRef().StartCombat(Game.GetPlayer())
Exact Error:
Starting 1 compile threads for 1 files...
Compiling "TIF__010100AA"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(9,0): variable Alias_GSQTulys is undefined
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(9,15): none is not a known user-defined type
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(9,24): none is not a known user-defined type
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010100AA.psc(16,15): cannot name a variable or property the same as a known type or script
No output generated for TIF__010100AA, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__010100AA
User avatar
Rhi Edwards
 
Posts: 3453
Joined: Fri Jul 28, 2006 1:42 am

Post » Wed Jun 20, 2012 4:11 pm

You need to post your entire script because your posts don't give enough info.
User avatar
Isaac Saetern
 
Posts: 3432
Joined: Mon Jun 25, 2007 6:46 pm

Post » Wed Jun 20, 2012 10:58 am

Go to the "Scripts" tab in your quest, and copy the source for the script with the long weird name...it's the fragment script and will tell us what else is going on.
User avatar
Ashley Hill
 
Posts: 3516
Joined: Tue Jul 04, 2006 5:27 am

Post » Wed Jun 20, 2012 9:14 am

I think this is the entire script.
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 1Scriptname TIF__010100AA Extends TopicInfo Hidden;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODEAlias_GSQTulys.GetRef().StartCombat(Game.GetPlayer());END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentQuest Property GSQ01  Auto  Quest Property MyFirstQuest  Auto  Int Property NewProperty  Auto  Quest Property FirstQuest  Auto  
User avatar
Rachel Hall
 
Posts: 3396
Joined: Thu Jun 22, 2006 3:41 pm

Next

Return to V - Skyrim