Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Very Basic OnHit Script


Leecarter
 Share

Recommended Posts

Hello everyone, nice forums you have here. :)

So I'm just getting my feet wet with the CK. I've made some new very basic perks and I'm trying to attach a script to one. I've got the script associated to the perk fine.

Ultimately I want to populate a WEAPON property via the perk's script property dialog. But right now I'm just doing an extremely basic script to make sure I've got all my pieces put together right. Turns out I don't.

The script:


Scriptname GM_fstLight extends ObjectReference



Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) 



Debug.notification("In onHit!")



EndEvent

The log:

error: Unable to bind script GM_fstLight to (14000D63) because their base types do not match.

Any ideas where I went wrong? I'd really appreciate it.

Thanks, Lee

Link to comment
Share on other sites

I have no clue what reference perk scripts use. That could be the problem. Given that the CK is so new it's a pain finding online answers to questions like that. But then I suppose that's what we're creating here. :)

Not sure what you mean by having no conditions for checking what is doing the hitting. My thoughts were just to get a working script that drops me a note in the log, I was going to take baby steps and add conditions to the script later. Unless I need to do that somehow to get it to work.

The script must be getting associated to the character somehow because "error: Unable to bind script GM_fstLight to (14000D63) because their base types do not match." pops up in the log every time my character is hit. So if I start the game and get hit twice, the error appears twice. If I get hit 3 times the same error appears 3 times, and so on.

So I've got to be close.

Edited by Leecarter
Link to comment
Share on other sites

Solution: echo pointed me in the right direction when he mentioned ObjectReference. Thanks.

The way I'm understanding it, that perk scripts must extend Perk, and since Perk does not have access to OnHit() it wouldn't bind correctly (just like the error above said).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. 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.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...