Jump to content

Some questions about scripts


Luke

Recommended Posts

17 hours ago, CamDawg said:

In this case you're better off just directly using the numeric values here; I believe this construction is from NI's parser. STUNNED is 0x8, HELPLESS is 0x20, so you can safely use


!StateCheck(NearestAllyOf(Myself),0x28)

If you're going to be using it often it might be worthwhile to add it as a custom entry to state.ids.

 

Yes, you're right, that construction is from NI's parser. Thanks for the tip about using the HEX values of STATEs......

Do you perhaps know how can I use REPLACE_BCS_BLOCK to replace more than one script block?

EDIT: OK, I found the issue: REPLACE_BCS_BLOCK can replace multiple blocks only if they're consecutive (which is bad IMHO.......)

Edited by Luke
Link to comment

Don't think so, SoD AI works fine with the former.

On the other hand, NearestEnemyOf and NearestEnemyOf() do differ, as the latter defaults to by myself, but the former iirc has been also returning objects from non-myself actors as well.

Link to comment
On 2/10/2019 at 1:25 PM, Ardanis said:

It's a hex sum of bits, each responsible for one of debilitating states. E.g. confusion, feeblemindedness, silence, various deaths etc. If at least one is true, then the sum is also true.

Good to know, thanks!

What about STATE_HARMLESS instead?

Link to comment

Separately, is it intended that the information about the object LastSummonerOf() is lost every time you save and reload a game?

Suppose a CRE has a script like this:

IF
	StateCheck(LastSummonerOf(Myself),STATE_REALLY_DEAD)
THEN
	RESPONSE #100
		Kill(Myself)
END

If I'm not mistaken, the Kill() action doesn't get executed if I save the game, reload and kill its last summoner......

Edited by Luke
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...