Can't Save Script In Cs With Obse

Post » Tue Sep 22, 2009 2:07 am

scn SneakForceFeedSCRIPTref actorfloat headingshort keycodeshort curkeyshort stagefloat fquestdelaytimeBegin GameModeset fquestdelaytime to 0.01set keyCode to 22let actor := GetCrossHairRefif (actor.IsActor) && (victim.GetIsCreature == 0) if ( curKey && isKeyPressed2 curkey ) elseset curkey to 0endifif ( isKeyPressed2 keyCode )let heading := actor.GetHeadingAngle playerlet heading := abs headingif (heading > 160)set curKey to keyCodeplayer.additemns 0SFeedingRing 1actor.additemns 0SFeeded_uponRing 1set stage to 1returnendifif(stage == 1)player.pickidle 1actor.pickidle 1set stage to 2returnendifif(stage == 2)player.removeitemns 0SFeedingRing 1actor.removeitemns 0SFeeded_uponRing set stage to 3returnendifif(stage == 3)let maxFatigue := -1 * actor.GetAV fatigueplayer.pickidle 0actor.pickidle 0actor.ModAV2 fatigue maxFatigueset stage to 0returnendifEnd 


Thanks
User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Post » Mon Sep 21, 2009 9:47 pm

What exactly are you trying to do with this script? I'm not sure if I understand what you're trying to do here. I can tell you that the script won't compile due to missing endif's. Every if must end with endif somewhere somehow or the CS will start to whine and cry.

Ex:
scn SneakForceFeedSCRIPTref actorref victimfloat headingshort keycodeshort curkeyshort stagefloat fquestdelaytimeBegin GameMode		set fquestdelaytime to 0.01		set keyCode to 22		let actor := GetCrossHairRef	if (actor.IsActor) && (victim.GetIsCreature == 0) 		if ( curKey && isKeyPressed2 curkey )		; Do Nothing?		else		set curkey to 0	endifendifEnd


Also have you defined "victim" anywhere? I doubt "victim" is going to work without a reference.

I don't think this script is going to work.
User avatar
Quick Draw
 
Posts: 3423
Joined: Sun Sep 30, 2007 4:56 am

Post » Tue Sep 22, 2009 5:32 am


Also have you defined "victim" anywhere? I doubt "victim" is going to work without a reference..

Sorry it's a mistake, it's it's suposed to be actor :P

Could you fix the endif's please ?
User avatar
KIng James
 
Posts: 3499
Joined: Wed Sep 26, 2007 2:54 pm

Post » Mon Sep 21, 2009 5:36 pm

scn SneakForceFeedSCRIPTref actorfloat headingshort keycodeshort curkeyshort stagefloat fquestdelaytimeBegin GameModeset fquestdelaytime to 0.01set keyCode to 22let actor := GetCrossHairRefif (actor.IsActor) && (actor.GetIsCreature == 0) 	if ( curKey && isKeyPressed2 curkey ) 		NOTHING HERE TO DO.	else		set curkey to 0	endifendifif ( isKeyPressed2 keyCode )	let heading := actor.GetHeadingAngle player	let heading := abs heading	if (heading > 160)		set curKey to keyCode		player.additemns 0SFeedingRing 1		actor.additemns 0SFeeded_uponRing 1		set stage to 1		return	endifendifif(stage == 1)	player.pickidle 1	actor.pickidle 1	set stage to 2	returnendifif(stage == 2)	player.removeitemns 0SFeedingRing 1	actor.removeitemns 0SFeeded_uponRing 	set stage to 3	returnendifif(stage == 3)	let maxFatigue := -1 * actor.GetAV fatigue	player.pickidle 0	actor.pickidle 0	actor.ModAV2 fatigue maxFatigue	set stage to 0	returnendifEnd 
There's the if's and endif's straightened out, but I don't think the first if statement works right, and there is no result for that one.
User avatar
SUck MYdIck
 
Posts: 3378
Joined: Fri Nov 30, 2007 6:43 am


Return to IV - Oblivion