Jump to content

Need a script? Maybe I can help.


fg109

Recommended Posts

OK... what you asked had nothing to do with scripting but I tried anyway. I did what you described and had exactly the same results. But after lots of experimentation, I thought of weapon racks and mannequins. Supposedly, they don't always work correctly if they are at one of those nice Z angles (0, 90, 180, 270) so I tried changing the Z angle of the trigger to -15. It worked! Don't know why it is, but that's how you have to do it.

 

Also, read this on how to create primitives. Since you're making a trigger, click the cube with a 'T' on it, not a 'C'.

 

EDIT: Also, if you don't mind, please update the wiki article so that others don't have the same problem.

 

Okay I tested this and found it was partly true. The other problem was if my "Base Model" the trigger was made from wasn't named, aka "Chest", the activate option would not show up.

 

Another problem is that if I had a script on my chest, the trigger would duplicate that script causing problems with the "triggerRef" so the player was triggering the chest instead of the triggerbox, which is an issue with the chest script knowing who is triggering the chest. I need the triggerbox to pass itself as the trigger, and not the playerRef.

 

Sorry if this wasn't a scripting issue. Thanks for looking into it though.

 

As for the CK Wiki, I don't ahve Auth to change it.

 

ADDED COMMENT:

I had to work around this problem. I found an alternative solution. So no need to help any farther. Thanks

Edited by leedavis
Link to comment
Share on other sites

  • Replies 272
  • Created
  • Last Reply

Top Posters In This Topic

How bout a script so that when an enemy dies for the first time, it gets revived and continues to fight.

 

Scriptname Example extends Actor

Bool Revived

Event OnDying(Actor akKiller)
if !Revived
	Revived = True
	Utility.Wait(5)
	Resurrect()
endif
EndEvent

Link to comment
Share on other sites

LOL! Reminds me of Martigan's Monster Mod. The Zombies never stayed dead. Realistic, but scary as hell.

 

I actually have another scripting question if possible.

 

How about a script that animates the Player. I'd like to allow the player to sit on a non-sitable object.

 

Thanks

Link to comment
Share on other sites

Why not just use the "ChairInvisibleSingle"?

 

Bummer...I got excited.

 

chairinvisiblesingle is a static object and cannot be moved in game or by scripts. I need the Player to be able to sit when I tell him to.

 

Also, I dragged it into my cell and tested it...I couldn't use it in game. How do I make it work?

 

Edit: Crap. That was easy. I added an "OnActivate" function script to an Activator, so that when the Activator was "Activated" it would "Activate" the "chairinvisiblesingle" (that is a lot of activating going on)

END Edit

 

I'll keep trying to make this work.

 

Thanks anyway.

Edited by leedavis
Link to comment
Share on other sites

Why not just use the "ChairInvisibleSingle"?

 

Bummer...I got excited.

 

chairinvisiblesingle is a static object and cannot be moved in game or by scripts. I need the Player to be able to sit when I tell him to.

 

Also, I dragged it into my cell and tested it...I couldn't use it in game. How do I make it work?

 

Edit: Crap. That was easy. I added an "OnActivate" function script to an Activator, so that when the Activator was "Activated" it would "Activate" the "chairinvisiblesingle" (that is a lot of activating going on)

END Edit

 

I'll keep trying to make this work.

 

Thanks anyway.

 

Sorry, thought you wanted to have the player sit at a specific spot. But it shouldn't be hard to script it so that the player will sit anywhere...

 

 

Furniture property ChairInvisibleSingle auto
ObjectReference CurrentChair

Function SitAt(ObjectReference Target)
CurrentChair = Target.PlaceAtMe(ChairInvisibleSingle)
CurrentChair.Activate(Game.GetPlayer())
RegisterForAnimationEvent(Game.GetPlayer(), "IdleFurnitureExit")
EndFunction

Function CleanUp()
CurrentChair.Disable()
CurrentChair.Delete()
CurrentChair = None
EndFunction

Event OnAnimationEvent(ObjectReference akSource, String asEventName)
UnregisterForAnimationEvent(akSource, asEventName)
Utility.Wait(1)
CleanUp()
EndEvent

 

 

So whenever you want to sit, just call the function "SitAt(Game.GetPlayer())" if you want the player to sit at the exact spot he/she is currently standing, or else "SitAt(SomeTarget)" to sit at SomeTarget.

 

I haven't tried it out, so I don't know if the player really does send an "IdleFurnitureExit" event when he/she gets out of a chair.

Edited by fg109
Link to comment
Share on other sites

Hi fg, I think it's very nice of you to offer your scripting expertise to noobs like me. Kudos to you!

 

My mod with over 100k downloads and 740 endorsements has two most popular requests about triggering and reseting mechanism of the arena and executioner's chopping block. Any chance you would be so kind to help me with activators(levers and such) scripts to trigger and reset the fighting and execution?

 

Currently I'm using a work-around by placing the gladiators/execution-guard behind a gate, and use a lever thingy to control the gates. So when you want the fight/execution to start, you just pull the lever. But it does't work every time, as NPC sometimes just navmesh-jump their way across the gate and start the fight/execution themselves.

 

For the arena, there are 2 teams: A and B. Each team has 3 gladiators: A1, A2, A3 and B1, B2, B3. My goal is to make them stand where they are til you pull one lever. They are now set as enemy factions so if they can move they will start the fight to death. And when one team wins by killing all 3 members of the other team, player will have the option to pull another lever to resurrect the fallen and place both teams back to their original spots, and make them not movable again.

 

As for the execution, I have no problem placing the executioner and the victim in position, but the key is the NPC with keyword "isexecutionguard", which is the NPC who push the victim from behind to the block. My goal is to make a lever that triggers him moving towards the chopping block and then use the chopping block (a special furniture), then the beheading animation will start automatically. Then another lever would function as "reset button": resurrecting the victim, and place all 3 NPC (victim, executioner and executioner guard) back to original spot, so you can watch the execution again.

 

I would appreciate all the help I can get, scripting or other ways to do the job. I'll also be more than happy to list you in my mod's credit list.

 

Sincerely Yours,

H

Edited by hydralisk77
Link to comment
Share on other sites

Hi,

 

Is it possible to script a spell so that it adds an effect (say like a disease) to the player,

e.g. the player casts this spell and it does masses of damage to his opponent but adds an incurable (by normal means) disease to the player?

 

I'd like to know this because I'm working on a construct race (e.g. an Android, it'd have to be Dwemer in origin) and I'd like them to be able to sacrifice a little bit of their energy/power/electricity (health) to hurt their enemies and then have to find a specific object to recharge them (most likely a power cell).

 

 

Thanks

Link to comment
Share on other sites

Hey...

 

First of all thanks for offering yourself to help us.

Here's my issue:

 

I want to make it so that you can either use a container that can hold only, say, potatoes (and only potatoes, i've seen something like Function AddInventoryEventFilter(Form akFilter) native function or something might come in handy) or a simple activator object to remove the potatoes from inventory (if player has any) AND make them appear in certain locations that should probably be specified by leveled item dummies; so that if the player activates or puts 4 potatoes in the container , and there are a total of 5 dummies, the potatoes that have ID 1 2 3 and 4 should appear AND IF the player picks up the potato ID 2 , then activates or puts another potato in the container, the ID 2 or 5 should appear ( remember that ID 2 has been already used so it has to respawn that's why i think i have to use leveled item dummies, i might be wrong though) .

Parenting the potato dummies to the activator ( dunno if it will work to container ) might ease up the job.

Might be difficult tough, for me it is anyway so if you have any insights id appreciate it much.

I also hope it can be achieved without the need of the script extender, i've got a bad feeling about this.

 

If that can't be achieved then maybe i could make several containers that have different meshes ( a basket that has one or more apples) and that appear and disappear judging by the number of apples within and that of course need scripting :

Item filtering first of all but i think if i make like say 21 types of meshes that have 0 to 20 apples in the basket, the one that has 20 apples inside( mesh apples) should be able to have within 20 or more apple items while others have to be limited ( the mesh containing 15 apples should have 15 apple items within and if the player changes the contents adding for example 2 more apples, upon exiting the trade menu the mesh that had 15 apples should disappear and the one that has 17 should appear, pretty logical)

I don't know how to make the containers appear and disappear like that, hopefully you understood what i'm trying to achieve here my english is a bit rusty.

Or maybe if the container the player interacts with is invisible and judging by the number of items in it , the proper mesh is activated and the old one disappears, yeah this one makes more sense to me.

Waiting for an answer :S

 

Thank you very much in advance :)

 

_____________________________________________

 

Another edit:

 

Scriptname Example extends Actor

Bool Revived

Event OnDying(Actor akKiller)
       if !Revived
               Revived = True
               Utility.Wait(5)
               Resurrect()
       endif
EndEvent

 

I don't want to sound big-headed or something but, wouldn't this script resurrect the actor over and over again or do i suck that bad at scripting ? the guy said that he wants the actor to be revived the first time it is killed so probably he meant he only wanted to be resurrected once?

Edited by bobbythecamel
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...