Struggling with the new script.

Post » Sun Jun 17, 2012 4:16 pm

Okay so I'm not very well versed in scripting and this is quite a simple script going here, it's a magic effect script that is supposed to end all combat on the player whenever he goes invisible.

In Fallout 3/Oblivion, it'd look like

begin ScriptEffectStart    player.stopCombatAlarmOnActor    stopCombatAlarmOnActor Playerend

However if I put it into that format I get

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\InvisibilityDropsCombat.psc(3,10): no viable alternative at input '.'
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\InvisibilityDropsCombat.psc(5,3): no viable alternative at input '\\n'

So... obviously that isn't going to work anymore. Although I'm editing straight from the source so maybe that's what is causing it.

How would I format this to make it work?
User avatar
kiss my weasel
 
Posts: 3221
Joined: Tue Feb 20, 2007 9:08 am

Post » Mon Jun 18, 2012 3:12 am

You really should go read the Wiki. That is no longer the correct format. Begin and End aren't used anymore.
User avatar
Rude Gurl
 
Posts: 3425
Joined: Wed Aug 08, 2007 9:17 am

Post » Sun Jun 17, 2012 9:28 pm

Skyrim uses an entirely new scripting language. Take a look at the wiki's http://www.creationkit.com/Category:Papyrus before you try to write anything.

Cipscis
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Mon Jun 18, 2012 12:44 am

Ahh I see. Alright, didn't quite catch that there was a new scripting language. They haven't done that in a while.
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Sun Jun 17, 2012 10:25 pm

Okay so, so far I got a script going down that kinda gives me what I'm after.

EVENT OnEffectStart(Actor akTarget, Actor akCaster);   debug.trace(self + " OnEffectStart: User Drops Combat")akCaster.StopCombatAlarm()ENDEVENT

However this only calls in one stopcombatalarm which in at least this scenario, does not end combat. I want invisibility to continue calling in stopcombatalarm commands while invisibility is on until the effect wears off.

So I've somewhat have been going with this script.

Scriptname InvisibilityDropsCombat extends activemagiceffect float xEVENT OnEffectStart(Actor akTarget, Actor akCaster);   debug.trace(self + " OnEffectStart: User Drops Combat")x = 1ENDEVENTFunction GetPlayer(Actor player)if x == 1  player.StopCombatAlarm()endifendfunctionevent OnEffectFinish(Actor akTarget, Actor akCaster)x = 0akCaster.StopCombatAlarm()akTarget.StopCombatAlarm()endevent

However it's having no affect in game.

I'm pretty sure the reason behind it is because "Actor Player" isn't actually letting the function be used on the player. I don't really get how I'm supposed to set this second part to be ran on the player, or if I'm even doing the variables right. Anyone have any ideas?
User avatar
WTW
 
Posts: 3313
Joined: Wed May 30, 2007 7:48 pm

Post » Sun Jun 17, 2012 2:53 pm

In order to get the reference to the player, you'll want to use this:
Game.GetPlayer()

Cipscis
User avatar
Brian Newman
 
Posts: 3466
Joined: Tue Oct 16, 2007 3:36 pm


Return to V - Skyrim