Begin Block

Post » Fri Dec 03, 2010 5:54 am

Hi guys!

I have a script here. It looks like this:

Begin [entry to combat]Sniffles.setscale 2Sniffles.ModAV Strength 35Sniffles.ModAV Endurance 35Sniffles.ModAV Speed 20Sniffles.ModAV Aggression 20EndBegin [exit from combat]Sniffles.setscale 1Sniffles.ModAV Strength -35Sniffles.ModAV Endurance -35Sniffles.ModAV Speed -20Sniffles.ModAV Aggression -20End


Ok, that's what I have so far. I need a command for the begin block.
What I want to happen is that when the player or Sniffles (the rabbit) enters combat, he grows twice his original size, he gains 35 in strength and endurance and 20 in speed and aggresion. When Sniffles exits combat, he returns to normal.
Can someone take a look at and verify my script?

Also, is there some kind of visual I can use to simulate Sniffles growing?
I don't mind using OBSE
Thanks in advance

P.S Feliz navidad!
User avatar
Damian Parsons
 
Posts: 3375
Joined: Wed Nov 07, 2007 6:48 am

Post » Fri Dec 03, 2010 7:40 am

http://cs.elderscrolls.com/constwiki/index.php/Begin
User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Fri Dec 03, 2010 9:32 am

Hmm, there doesn't seem to be a block that would fit the script.

I had a look through the 'functions' category on the CS Wiki, but to no avail. Is there any thing that can be done?
User avatar
Dewayne Quattlebaum
 
Posts: 3529
Joined: Thu Aug 30, 2007 12:29 pm

Post » Fri Dec 03, 2010 4:43 am

Just run your stuff in a GameMode block and use IsInCombat as a condition. :)
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Fri Dec 03, 2010 11:28 am

http://cs.elderscrolls.com/constwiki/index.php/IsInCombat

I would avoid, setting the script to run on game mode. You can create an ability called " ....... " or whatever, add it to sniffles and then use a scriptEffectUpdate block to permanently check whether sniffles is in combat or not.

scn BattleRoarbegin ScriptEffectStart    short growthEndbegin ScriptEffectUpdate      if ( sniffles.IsInCombat )      Sniffles.setscale 2       Sniffles.ModAV Strength 35       Sniffles.ModAV Endurance 35       Sniffles.ModAV Speed 20       Sniffles.ModAV Aggression 20       set growth to 1   elseif ( growth )        Sniffles.setscale 1        Sniffles.ModAV Strength -35        Sniffles.ModAV Endurance -35        Sniffles.ModAV Speed -20        Sniffles.ModAV Aggression -20        set growth to 0   endifEnd


You also may want to consider using ModAV2 instead of ModAV.
User avatar
Pat RiMsey
 
Posts: 3306
Joined: Fri Oct 19, 2007 1:22 am

Post » Fri Dec 03, 2010 6:20 am

IsInCombat
From The Elder Scrolls Construction Set Wiki

Syntax

[ActorRef].IsInCombat 

Returns 1 if the actor is currently in combat.

Notes
Even though not seen as a syntax error by the CS, IsInCombat ActorRef will not compile in-game. Consequently, it will cause the whole script not to be compiled. You need to use GetCombatTarget instead.

Apparently IsInCombat doesn't work.
GetCombatTarget is practically useless for what I'm trying to do.
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Fri Dec 03, 2010 7:33 am

Apparently IsInCombat doesn't work.

No, what that note is saying is that you must use the form "actorRef.IsInCombat" rather than the form "IsInCombat actorRef". It should work the way it's written in the script.
User avatar
Nomee
 
Posts: 3382
Joined: Thu May 24, 2007 5:18 pm

Post » Fri Dec 03, 2010 8:20 am

I would avoid, setting the script to run on game mode. You can create an ability called " ....... " or whatever, add it to sniffles and then use a scriptEffectUpdate block to permanently check whether sniffles is in combat or not.


Wouldn't this effectively be like running a game mode script, since it would be running anytime the scripted reference was loaded either way? :ermm:
User avatar
Ashley Hill
 
Posts: 3516
Joined: Tue Jul 04, 2006 5:27 am

Post » Fri Dec 03, 2010 10:16 am

No, what that note is saying is that you must use the form "actorRef.IsInCombat" rather than the form "IsInCombat actorRef". It should work the way it's written in the script.

Ohh, ok. I have the script set up, now I just need to test it all out.
User avatar
Jack
 
Posts: 3483
Joined: Sat Oct 20, 2007 8:08 am


Return to IV - Oblivion