Jump to content

Need a script? Maybe I can help.


fg109

Recommended Posts

Could you help with mine?

 

Its a script that will be tied to constant effect spell that returns 33% of all damage taken into Magicka restore. The Damage would still be delivered 100%, just 33% of whatever that is = magicka gain.

 

Its very similar to how http://skyrim.nexusmods.com/downloads/file.php?id=8547 works. I pulled apart the script that came with it to learn how to do mine but couldn't get it to work.

 

Scriptname PPDamagetoMagickaEffect extends activemagiceffect
{Script for Paladin's Damage into Magicka Restore effect.}

float pPrevHealth

float Property MagickaRstPercentage = 0.33 auto
{Percentage of taken damage to restore}

Event OnHit()
Actor target = GetCasterActor()
float CurMagicka = target.GetAV("Magicka")
if dmgAmount > 0
	float rstMagicka = dmgamount * MagickaRstPercentage
	
endif

endEvent

Link to comment
Share on other sites

  • Replies 272
  • Created
  • Last Reply

Top Posters In This Topic

  On 4/16/2012 at 4:57 PM, fg109 said:

@hydralisk77

 

Have you tried experimenting with the Hold type AI packages? If you are sure you want to use scripting, I can think of a couple ways to do it. The easiest way to do it would be to disable the gladiators' AI until the fight starts, but I am not sure you want that, since that also disables any animation or movement.

 

You can also place a collision cube around the gates and change the collision layer to L_Navcut. This will disable any navmesh that it intersects, which should prevent the navmesh jumping you're seeing. So this collision cube should be enabled while the gates are closed, and disabled when the gates are opened. (Just keep increasing the size until the NPCs can't get past it.) I don't know if it'll actually work though since from my experience, NPCs in combat has no need of navmesh to move around.

 

 

  Reveal hidden contents

 

 

So if you want to go with enabling/disabling the actors' AI, set AIMode to true, otherwise if you want to go with using collision cubes, set AIMode to False. Fill the GroupA and GroupB arrays with the gladiators from each team. If you're using collision cubes, then fill the EnableObjects array with the collision cubes.

 

As for your second request with the execution, I would have to take a look at the main quest to see how it's done. I suspect that they use a scene though, and I haven't done anything with that before.

 

EDIT: Forgot to mention that I'm assuming the gates you're using are actually the PortGatePole01 activators, and that you have a lever set up as their activate parent.

 

Hi fg,

 

Thanks so much for uploading a working script for me! It worked great after I selected the AI toggle mode. I hide the gladiators in a room so they won't look weird before the fight. Sometimes reseting the fight after one team won will crash the game but it's a small price to pay for a good working script.

 

I used the same script on the chopping block and got it to work somehow too. It just won't reset the dead victim like it did for the arena.

 

I am now doing a beta test of the mod with your script. Sometimes the script working perfectly on my pc doesnt work at all on other peeps'.

 

Anyways, just want to thank you for the help and you are added to the credit list of my mod. I know you didn't do it for thist, but I think you deserve to have your work credited.

 

H.

Link to comment
Share on other sites

@Armornv

 

I don't know whether it's the right idle or not:

 

 

  Reveal hidden contents

 

 

 

@screamingabdab

 

You need to add a keyword property for "ArmorHelmet" to the script, then change line 122 from

 

if (akBaseItem as Armor)

 

to

 

if (akBaseItem as Armor) && (akBaseItem.HasKeyword(ArmorHelmet)

 

 

@eschaon

 

I haven't taken a look at the mod you linked to, but if you change your script to this, it should work pretty well:

 

 

  Reveal hidden contents

 

Edited by fg109
Link to comment
Share on other sites

Thanks for that fg! The script compiles fine, but alas, he still has the standing on the ground pose. Getting closer, but I didn't see anything else related to an idle flight. :( Also for some reason, if there is a coc marker heading in the room, he goes to that now instead of the x marker heading he used to go two. No biggie, Just there while im building the room.
Link to comment
Share on other sites

I don't know it this has already been asked, but would you be willing to put together a script that takes control of the first-person camera (I'd assume it's the 1stPCam object in the editor) for use in creating a cinematic camera for cutscenes and the like?
Link to comment
Share on other sites

@Xenon32

 

I'm sorry, but that's beyond my abilities. I've looked but there are almost no scripting commands related to cameras, and I can't think of any way to use the ones that are there to do what you describe.

Link to comment
Share on other sites

Ive got one. Do you know how to force the player to activate furniture? I ask because there is no function for showing a crafting menu. Ive tried everything from packages, quests, scenes, and moving crafting benches directly to the player and doing Game.GetPlayer().Activate(CellBench).

 

Heres what I got going on now. I have a MiscObject with the below script attached. Im trying to set it up so when the player drops the MiscObject from their inventory the script catches that and moves an alchemy lab from an empty cell I made to the player and then force the player to activate the table which should pull up the crafting menu. All debug scripts play at the correct times. If I ever get that portion working Im gonna fix it up so when you drop the item it is instantly added back to inventory ready to be "triggered" again.

 

 

  Reveal hidden contents

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...