Help getting started with scripts?

Post » Wed Jun 20, 2012 3:01 am

Heya, I'm anxious to get started on some scripting, but I'm having some trouble with the initial hump of understanding how things work. I'm a Computer Science major going in to the third year, so I have experience programming. Problem is, all of the tutorials I've looked at involve editing things in the worldspace and generally adding new content. What I don't understand is how to go about changing the behaviour of existing content. That's my main interest.

So, say I want to change how critical hits/bleeding work. Does that mean I'd have to make a new script that extends Actor, with my own functionality, and attach it to every single Actor in the game? That seems incredibly tedious. Not to mention, it seems I can't attach any scripts to Actors that appear in leveled lists. Are there no core scripts where I can find things like critical hit/bleeding calculations and edit them from there? That would be the simplest solution, but I haven't been able to find any.

Any assistance would be greatly appreciated. I just need to get over this initial hump before I can start to really work.
User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm

Post » Wed Jun 20, 2012 2:14 pm

If you want to change something glovally, the first shoot is to chek if is a game setting controlling this. If not, in the case you use as an example, a better way (yet not the best, but is an example after all) would be to create various scripted aliases and attach them to the actors in the cell, dettaching them again when you are far. There are a lot of things to keep in mind, not only scripts. There are game settings, glovals, AI packages, combat stiles, aliases quests...

I had the same tendency to jump at the scripts at first oportunity, but it's not always the best move.
User avatar
ChloƩ
 
Posts: 3351
Joined: Sun Apr 08, 2007 8:15 am

Post » Wed Jun 20, 2012 12:09 pm

http://www.youtube.com/watch?v=pii5K8MNfh8
User avatar
GRAEME
 
Posts: 3363
Joined: Sat May 19, 2007 2:48 am

Post » Wed Jun 20, 2012 4:17 pm

If you want to change something glovally, the first shoot is to chek if is a game setting controlling this. If not, in the case you use as an example, a better way (yet not the best, but is an example after all) would be to create various scripted aliases and attach them to the actors in the cell, dettaching them again when you are far. There are a lot of things to keep in mind, not only scripts. There are game settings, glovals, AI packages, combat stiles, aliases quests...

I had the same tendency to jump at the scripts at first oportunity, but it's not always the best move.

Is there any documentation somewhere regarding the aliases? I checked out all the other stuff like globals, AI, styles, etc before I even touched scripts, so I don't think there is any other option. I'm still not sure how this is supposed to work, though. I tried just a very basic script for testing purposes:
Scriptname TestFeedback extends ActorEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)Debug.MessageBox("You were hit by " + akAggressor)endEvent

I attached it to the Bladesman perk. So the way I understand it, the script should fire whenever an actor with the perk (in this case, the player) enters the OnHit event? No compiling errors, but it never fires.
User avatar
Nomee
 
Posts: 3382
Joined: Thu May 24, 2007 5:18 pm

Post » Wed Jun 20, 2012 9:37 am

The Intermediate Quest Tutorials on the wiki show you all about Aliases and such like.

I know it might seem a bit baby - and to be honest, it is the wrong way to do things, anyway - but it expects you to do the Basic Quest Tutorial First ... which it then builds on.

After that, Doug's tutorials in the sticky at the top of this forum are very good for Aliases, AI Packages, Quests and Quest Scenes (and such like)
User avatar
Alex [AK]
 
Posts: 3436
Joined: Fri Jun 15, 2007 10:01 pm

Post » Wed Jun 20, 2012 3:25 pm

Your script extends Actor, so it's meant for an actor and the Bladesman perk is, well, a perk.
User avatar
Alister Scott
 
Posts: 3441
Joined: Sun Jul 29, 2007 2:56 am

Post » Wed Jun 20, 2012 5:27 am

The Intermediate Quest Tutorials on the wiki show you all about Aliases and such like.

I know it might seem a bit baby - and to be honest, it is the wrong way to do things, anyway - but it expects you to do the Basic Quest Tutorial First ... which it then builds on.

After that, Doug's tutorials in the sticky at the top of this forum are very good for Aliases, AI Packages, Quests and Quest Scenes (and such like)

Thanks, I'll check those out and see if they help me any.

Your script extends Actor, so it's meant for an actor and the Bladesman perk is, well, a perk.

Ah, well that's embarrassing. I assumed it would be attached to the perk and trigger on the actor through it. I didn't realize the perk itself was the object. Just so I know, what kind of options do I have to actually attach a script to an Actor? I know I can attach scripts to individual Actor templates, but I can't do it with those that appear in leveled lists (which is rather essential), and what if I want something to apply to all actors globally?
User avatar
Add Me
 
Posts: 3486
Joined: Thu Jul 05, 2007 8:21 am

Post » Wed Jun 20, 2012 8:56 am

Check out the note at the bottom on the http://www.creationkit.com/Actor_Script page on the CK wiki. I haven't tried it, but I assume it works.

I have no idea how you'll apply a script to all actors globally. I don't think you actually need to do that, just on the actors that are currently near the player. So check out http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/ for a way of doing that.
User avatar
Vahpie
 
Posts: 3447
Joined: Sat Aug 26, 2006 5:07 pm

Post » Wed Jun 20, 2012 2:26 am

Check out the note at the bottom on the http://www.creationkit.com/Actor_Script page on the CK wiki. I haven't tried it, but I assume it works.

I have no idea how you'll apply a script to all actors globally. I don't think you actually need to do that, just on the actors that are currently near the player. So check out http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/ for a way of doing that.

Thanks, I'll check that out. So that is the only real way to simulate an OnHit (Actor doing the hitting) right now? Is there any function to return damage done? I want to make critical hits and bleeding damage be based on a percentage of damage done. The actor value Melee Damage doesn't seem to do anything, and I haven't found anything else.
User avatar
Sista Sila
 
Posts: 3381
Joined: Fri Mar 30, 2007 12:25 pm


Return to V - Skyrim