Jump to content

checking AP-requirement of current Weapon


jedidia

Recommended Posts

my Turn-based Mod is taking shape a lot faster then I expected, but now I stumbled over a little problem that I wasn't yet able to resolve. I need to check the APs of the current weapon equiped and modify the players AP accordingly. The code I came up with looks as follows (it's only an outtake of the whole, but everything that's essential for the problem is there):

 

		short lastaction1
	ref CurWeapon
	float CurWeapAP

set lastaction1 to player.getanimaction
	set CurWeapon to Player.GetEquippedObject 5
	set CurWeapAP to CurWeapon.GetWeaponActionPoints
if LastAction1 == 2
		player.damageav ActionPoints CurWeapAP
	endif

 

I can't find any errors in the syntax, but then again, I first looked into the scripting language 4 days ago. The problem here is that there seems to be no value passed on to CurWeapAP, because if I replace it with a numeric value (e.g. 10) in the second last line, the code works fine. so I guess the trouble is hidden somewhere in those two lines:

 

set CurWeapon to Player.GetEquippedObject 5

set CurWeapAP to CurWeapon.GetWeaponActionPoints

 

Can anyone spot what might be wrong with them?

Link to comment
Share on other sites

Just so that everyone knows that this has been answered, here is my answer from the relevant thread on the Official forums:

You want to use this syntax for GetWeaponActionPoints:
set CurWeapAP to GetWeaponActionPoints CurWeapon

That's an easy mistake to make though, so don't sweat it. For more information on FOSE function syntax see this - Function Syntax Format.

 

Cipscis

Cipscis

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...