Vortaka Posted February 24, 2009 Share Posted February 24, 2009 Hey everybody... Well, I just want to know if there is a variable/function/command or whatever you can call it, that "knowns" your follower (I'll take Jessi as an example) killed someone... So that the followers can share some xp with me... Ex.: OnGameMode if (Jessi.KilledSomeone == 1) 'Yeah, really, she killed someone! rewardXP 1 'She shares 1 xp with you (wow!) set Jessi.KilledSomeone 0 'Put the variable back to 0 awaiting the next kill...endif So, what I want to do, everytime Jessi kills someone, I want to gain 1xp... Can this be done? Thanks for any answers! Vortaka Link to comment Share on other sites More sharing options...
Cipscis Posted February 24, 2009 Share Posted February 24, 2009 This would be fairly difficult to do. For the player it's easy, as we have tools such as GetPCMiscStat and "Add Leveled List On Death" Entry Point Perks, but for other actors it's a little more difficult. I would recommend using a scripted explosion to add a token (an unplayable, therefore invisible, piece of armour) to all dead Actors within a certain range of your follower that don't already have one in their inventory. This token, when added would check IsKiller to check if it was your follower that killed them, and if it was then some code could be run. In other words, the token would have a script like this:ref rContainer Begin OnAdd set rContainer to GetContainer if followerRef.IsKiller rContainer ; Some code endif EndFor a good "how-to" by Reneer about using a scripted explosion to add tokens to nearby Actors, have a look at this post on the Official GECK Forum. There may be other ways to do this, but at the moment this is the only one that I can think of off the top of my head. Cipscis Link to comment Share on other sites More sharing options...
Vortaka Posted February 24, 2009 Author Share Posted February 24, 2009 Hey, thanks! I'll need some time to figure it out, that's for sure... (I'm not very good in scripting stuff) but I can tell you that, with the explanation and the link you gave me, I can understand what to do... (Well, in a way I think!!!) If I understand correctly, and I hope I do, you give an invisible item to all dead actors by an explosion(?) (don't know what that is yet!) and the script when it's being added get the thing done... In my case, my character gets some XP... I wonder about how to add it only once but I guess I'll figure it out with some testing! Well, gotta try it out! Wish me luck (I'll probably need it!!! :P ) Hey, thanks again! Vortaka Link to comment Share on other sites More sharing options...
Cipscis Posted February 24, 2009 Share Posted February 24, 2009 Yep, that's pretty much how it works.1) A quest script regularly places an invisible explosion at your follower's location2) The invisible explosion adds an invisible item (a token) to all dead Actors that don't already have a token and are within its range3) The token checks if its container (the Actor it was added to) was killed by your follower and, if it was, runs some code The reason why the token checks whether or not its container was killed by your follower is because, if this check was done by the explosion, all dead Actors that weren't killed by your follower would be checked repeatedly. With this method, the token not only checks whether or not an Actor was killed by your follower, it also marks that Actor as "checked" so that it doesn't get checked again. I'm glad to hear that you understand what to do, good luck putting it all together! Cipscis Link to comment Share on other sites More sharing options...
Vortaka Posted February 25, 2009 Author Share Posted February 25, 2009 ref rContainer Begin OnAdd set rContainer.GetContainer if followerRef.IsKiller rContainer ; Some code endif EndHum... Just a thing... Wouldn't it be set rContainer to GetContainer instead?(set rContainer.GetContainer doesn't seem to work...)Vortaka Link to comment Share on other sites More sharing options...
Cipscis Posted February 25, 2009 Share Posted February 25, 2009 You're right, sorry about that. I wrote that script pretty hastily so I supposed I should be surprised that I made a mistake like that, thanks for pointing it out. I've edited my previous post to correct the script. Cipscis Link to comment Share on other sites More sharing options...
Vortaka Posted February 25, 2009 Author Share Posted February 25, 2009 Hum... Just a little thing... I'm currently "almost" running it... But it seems that I'm missing something... Hum... Could you give me any tip on how to create the explosion spell? I seem to get all the others right, but I don't really understand how to do the spell... When I create a spell, I don't know where I should put it... Actor Effet? Base Effect? Which stats should I check... I'd like a little help, if you have time of course! Vortaka P.S. Hey, thanks a lot for the help! I really mean it! Link to comment Share on other sites More sharing options...
Cipscis Posted February 25, 2009 Share Posted February 25, 2009 You'll need to use a Base Effect first - set its "Effect Archetype" "Script" and set your script to be its "Assoc. Item". This Base Effect needs to be implemented as part of an Actor Effect that will be applied to a target, so you'll need to tick the "Touch" flag here. Then, you'll need to set up an Actor Effect that uses this scripted Base Effect. Once you've done this, you'll probably want to tick the "Disallow Absorb/Reflect", "Script Effect Always Applies" and "Area Effect Ignores LOS", as we don't want this to act like a regular spell/explosion. You're very welcome for the help. After all, that is why I come here - to help people. Cipscis Link to comment Share on other sites More sharing options...
Vortaka Posted February 25, 2009 Author Share Posted February 25, 2009 I don't get it... I've been 30 minutes trying to put the script in, but it doesn't appear in the assoc. Item... I don't seem to be able to get it in... I'll give it some more tries but seems that I'll only be able to finish this tomorrow... P.S. If you ever read this before tomorrow (for me anyway) and know the problem, could you give a tip? :) Vortaka P.S. Everything seems to work fine except the assoc. Item script... OH!!! I think I get it!!! Seems I forgot the Actor Effect implementation... (Even though I don't really know how to "implement"... Anyway, I'm going to sleep now!!! Tomorrow, fresh start!!! Btw, should I just "copy/paste" the effect? (the implementation?) Link to comment Share on other sites More sharing options...
Cipscis Posted February 25, 2009 Share Posted February 25, 2009 Sorry, I should have mentioned this before. You need to specify the script "Type" as "Effect" before it will appear in that list. You can do this in the "Script" window. Cipscis Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.