[NOOB] A simple script that...fails

Post » Thu Nov 05, 2009 10:26 am

Hello. I'm trying to make a simple script where when an activator is activated, then it'd cast to the player two different spells, depending if the PC is an Imperial or not. So far I've done:

Begin FFRM_AxeScriptif ( menumode == 1 )	returnendifif ( OnActivate == 1 )	if ( %PCrace != Imperial )		Cast "1FFRM_restore" Player					;Restore attributes.		MessageBox "You have been purified."     else          Cast "1FFRM_dieimperial" Player          MessageBox "Die, Imperial scum!"             ;A little gift xD	endifendifend


...but when the activator is activated, it open the PC inventory and gives a syntax error. So...what I'm doing wrong? :(
User avatar
Multi Multi
 
Posts: 3382
Joined: Mon Sep 18, 2006 4:07 pm

Post » Thu Nov 05, 2009 11:33 am

You can't use dialog variables in scripts; you have to use script functions:

Begin FFRM_AxeScriptif ( menumode == 1 )	returnendifif ( OnActivate == 1 )	if ( player->getRace "Imperial" == 1 )		Cast "1FFRM_restore" Player					;Restore attributes.		MessageBox "You have been purified."     else          Cast "1FFRM_dieimperial" Player          MessageBox "Die, Imperial scum!"             ;A little gift xD	endifendifend

User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Fri Nov 06, 2009 1:53 am

OK, now it works (with the script you've posted, with a few fixes ^^), thanks!

Another question, to cast different spells according to the faction the PC is in, is the command "player->getfaction" the correct one? And if I want to add more than one faction to the same "if", should it be: "ImperialLegion" OR "ImperialCult"?

And by curiosity...what's the difference between "Ability" and "Curse", when applying a constant effect on a PC?
User avatar
katsomaya Sanchez
 
Posts: 3368
Joined: Tue Jun 13, 2006 5:03 am

Post » Thu Nov 05, 2009 11:46 pm

Another question, to cast different spells according to the faction the PC is in, is the command "player->getfaction" the correct one?

I think so, but it might be PCFaction. or is that just for dialog?
And by curiosity...what's the difference between "Ability" and "Curse", when applying a constant effect on a PC?

Abilities can't be removed, they are what's used for things like the Birthsign effects.
Curses were never used in the game by Bethesda, but they're basically the same thing I believe. Except they can be removed with a Remove Curse spell, but they are not used in-game either.
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Thu Nov 05, 2009 5:12 pm

I think so, but it might be PCFaction. or is that just for dialog?

Abilities can't be removed, they are what's used for things like the Birthsign effects.
Curses were never used in the game by Bethesda, but they're basically the same thing I believe. Except they can be removed with a Remove Curse spell, but they are not used in-game either.


That might be confusing to some new modders (though for players this info is 100% correct). Abilities can't be removed in the normal course of gameplay. They can however be removed via dialogue or script by using the RemoveSpell function. :)
User avatar
Rachel Cafferty
 
Posts: 3442
Joined: Thu Jun 22, 2006 1:48 am


Return to III - Morrowind

cron