Jump to content

Need a script? Maybe I can help.


fg109

Recommended Posts

Okay there seems to be problems with updating using activemagiceffect. It just doesn't update ever. It works up until that point, because the player does join the faction, but then he stays at 0 forever. Even threw a Debug.Notification into the beginning of the OnUpdate Event, it never gets displayed.

 

I remember trying to use magic effects for a different script and ran into the same issue. Don't know why they never work right for me :/

 

Edit:

I'm pretty sure it just has to do with what I'm toggling or values I'm setting in the Effect editor and the Spell editor. Basically I have the script attached to an effect which is called by a spell. It's a lesser power, if that makes any difference

 

Edit #2:

Yep, I'm an idiot, lol. I had to set the duration to longer. The question now is would the player have to keep casting it every time it ran out? is there a way to set it to have infinite duration?

Edited by IluisIndustries
Link to comment
Share on other sites

  • Replies 272
  • Created
  • Last Reply

Top Posters In This Topic

@IluisIndustries

 

I successfully tested it by having it be the magic effect of an ability, and setting the value of "UpdateInterval" to 10.

 

EDIT: Also, if you experienced the same thing trying to use OnUpdate in a magic effect script before, then you probably had it as a spell or a lesser power and didn't set the duration of the effect. The magic effect script will only run as long as the spell is in effect (except in certain cases).

Edited by fg109
Link to comment
Share on other sites

I am attempting to make a wallmounted mudcrab into a container that respawns mudcrab ingredients. Can this be done through activators/triggers/npc's alone, or will it require scripting? I basically want a static harvestable mudcrab chitlin that respawns like a spider egg sack. Can I spawn a dead mudcrab in the void and link it to an activator placed over the wallmounted mudcrab, or is that overly complicated?

 

I haven't looked into scripting yet, but I've been working with the CK for a few weeks now. If this is a simple script I'd very much appreciate a working example so I can learn from it. If it is a complicated script, I'd still appreciate a working sample, but I'll save the learning for later haha.

 

If it isn't script related at all, I apologize for throwing it in here. I still have a lot of learning ahead of me with the CK.

 

Thanks!

Link to comment
Share on other sites

I am going to try and make a pub game for skyrim. I know how to make a set of replies, but how do I make them random? If you have never seen my thread on the matter, I said I wanted it to be where it would be a 45/55 w/l chance if speechcraft is lower than 50, and then a 55/45 if equal to or higher than 50. Is that possible with more than 2 responses? In other words, if I want this game to have 10 outcomes (in the form of NPC replies), can I make it so that the game will choose only one of the replies/outcomes, and as randomly as possible? Sorry if this is hard to understand, but explaining the creation kit and such has never been easy for me. :rolleyes:

 

Here's an example if it helps. :) If I roll a 5, and my speechcraft is less than 50, then I basically want the chances of the opponent rolling 1,2,3,4 or 5 to be slightly lower than the chances of him rolling 6,7,8,9 or 10. These would all be individual responses, but I don't mind putting that effort into the mod. I just want the game to be random. TY.

Edited by BeastlyBeast
Link to comment
Share on other sites

@UniqueKind

 

You don't need to use scripting for that at all. Edit the wall-mounted Mudcrab and copy the location and name of its nif model file. Extract it from the meshes BSA (or you could just create a dummy file in the meshes folder and rename it to the nif file). Create a new container in the CK and as its model, use the extracted (or dummy file). Fill the container with mudcrab chitin and place it wherever you want. Save and test your mod (remember to delete the dummy file if you made one).

 

 

@BeastlyBeast

 

Your request also doesn't require any scripting. There is a GetRandomPercent condition function that you can use on your replies. It chooses a random integer between 0 and 99 (inclusive). So if you wanted to have 10 random replies, the conditions would be like this:

 

  1. GetRandomPercent < 10
  2. GetRandomPercent < 11
  3. GetRandomPercent < 13
  4. GetRandomPercent < 14
  5. GetRandomPercent < 17
  6. GetRandomPercent < 20
  7. GetRandomPercent < 25
  8. GetRandomPercent < 33
  9. GetRandomPercent < 50
  10. No conditions

 

EDIT: Your example confuses me. Are you saying that you first choose a random number between 1 and 10 to choose how many replies that the NPC can choose from, and then the NPC chooses a random reply from that list?

Edited by fg109
Link to comment
Share on other sites

I'll try and write out how the conversation would go. I think that I'd only need 1 stage, and just a big huge section of a hundred or so dialogues.

 

Player Response: *Roll the dice* ----- NPC Response (Random Choice): You rolled... a six! Nice, higher number. Now I'll roll the dice. ----- Player Response: Okay. ----- NPC Response (Random Choice): I roll the dice, and get... a four. Oh, well. Here's your money.

 

I basically want to 'roll the dice' and then the NPC will respond with the random number that I rolled, then I'll say 'okay', which sets up the random number the NPC will roll.

 

EDIT: I think I see what you meant, with my example being confusing. You were thinking the PLAYER chose what number that they rolled, right? It wouldn't be like that. I want everything random to happen through NPC replies, as shown by the dialogue example above.

Edited by BeastlyBeast
Link to comment
Share on other sites

@BeastlyBeast

 

So both are supposed to be completely random? As in, what the NPC rolls should not depend in any way on what the PC rolls?

 

Well, I'd like it if my speechcraft played a role in it. Like earlier, I want my chances of winning to be slightly higher if my speechcraft is higher than 50. So, if I rolled a 3, and my speechcraft was 18, I'd want the chances of the opponent rolling 4-10 slightly bigger than rolling 1-3. And if I did the same thing but my speechcraft was 70, I'd want the opposite. Can't make a game, and not have some way to get better at it. :)

 

But other than that, yes, I want everything as random as it can be, and not based on anything else other than speechcraft.

Edited by BeastlyBeast
Link to comment
Share on other sites

@BeastlyBeast

 

OK, I suggest adding this to your quest script:

 

 

Scriptname YourQuestScript extends Quest Conditional

Int Property PCRoll Auto Conditional
Int Property NPCRoll Auto Conditional
Int Property PCWin Auto Conditional

Function CalculateRolls(Int iSides, Float NPCSpeech = 50.0)
PCRoll = Utility.RandomInt(1, iSides)
Float PCSpeech = Game.GetPlayer().GetActorValue("Speechcraft")
Float Modifier = (PCSpeech - NPCSpeech) / 100
NPCRoll = (Utility.RandomInt(1, iSides) - (Modifier * iSides)) as Int
if (NPCRoll < 1)
	NPCRoll = 1
elseif (NPCRoll > iSides)
	NPCRoll = iSides
endif
if (PCRoll > NPCRoll)
	PCWin = 1
elseif (PCRoll < NPCRoll)
	PCWin = 0
else
	PCWin = 2	;draw
endif
EndFunction

 

 

You can call the function whenever you start the dice game, and use the condition GetVMQuestVariable on the responses.

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