Jump to content

Recommended Posts

Posted

Hey... i have problem xD

and i don't even except answer in this topic cause i need something very hard to do :P

 

well easy in UE or C++ or Java but insane in CK xD

- Maybe cause of my knowledge in CK :P

 

 

ok... now im working on Production building in my Mod and...

Player in one building can Buy Space for Workers for example

House have 3 Loding for 3 Workers

 

and those 3 Spaces for workers can be spend for ppl who do one of possible jobs

for example:

- Guard ( our produciton buildings may be attacked )

( about this i will create new Topic soon cause all i can do is Spawn Enemy unit on XMarker :P )

- Miner ( working in Mine :P )

- Hunter ( worknig in Forest )

- Craftmaster ( making Special Items )

 

And for example we want to have 1 Guard and 2 Miners

Player choice NPC and send them to work...

 

i know i can use AiPackages to do it but normaly i was doing only

Packages to Simulate NPC Living in World

 

Static Packages are not so hard like "Dynamic" Packages :P

 

 

 

Any idea how can i do it ? :P

Posted (edited)

Sry 4 Double post but i want answer :tongue:

and im not sure Forum will show evey1 this Topic as Unreaded if i only edit it :tongue:

 

 

cause my ideas are pretty stupid so probably no1 can help me so i was looking all time for help

and i think i can do it by script... woho its gonna be long script xD

 

but i found something like this:

https://www.creationkit.com/index.php?title=MoveToPackageLocation_-_Actor

 

and LOL GJ to sm1 who write those tutorials... they are so useless...

Copy Paste from CK Wiki...

Syntax
Function MoveToPackageLocation() native
Parameters
None.

Return Value
None.

Examples
; Enable JonPaul and move him immediately to the location for his current package.
; Note that the Enable has to come first.
JonPaul.Enable()
JonPaul.MoveToPackageLocation()
Notes
This is mainly intended for use immediately after Enable, in cases where we want an actor to appear at its package location, rather than its editor location.

But WHY i have to Enable NPC first?

im gonna break Game again if i use MoveToPackageLocation without Enable b4?

 

xD

cause i don't wanna break my mod again T_T

most of my mods crash my game from time to time xD

 

cause of my stupid function uses :D

 

btw. im still not sure why should i use Mod Instead of SetValue but ok... im using Mod you Forum told me to use Mod xD

lol xDDDD

 

 

//Edit:

this Creation Kit Wiki is INSANE good... wow

 

6 almost empty lines = good tutorial

 

//Edit2:

this what i paste on top of this post i WHOLE PAGE of Creation Wiki...

w8... that 14 lines of text including Note , Example , Syntax etc.

Edited by TobiaszPL
Posted

The CK wiki pages are not, generally, intended as tutorials; they're meant as reference pages once you've got a handle on things, not to teach you all the bits. Unless they actively say 'tutorial', at least.

 

In your example, the actor needs to be enabled first, because disabled actors don't run packages, and so trying to move it to its package location is referring to a thing that doesn't exist.

 

 

As for the OP, what you'd want could be a Quest or set of Quests with aliases, three for each job type. You can use those aliases to add the appropriate Packages to any actor that fills them, which you would control through scripts, presumably triggered by dialogue.

 

Alternatively, you could just have three aliases, one for each worker, and have the full set of packages added to each one. Then, set up factions for each job you want (Miner, Guard, etc), condition the packages so that they only run if the worker is in the appropriate faction, and control what factions each has by script.

Posted

** Skip to Short Version PLS ! **

or read idc xD

 

 

Nah... im writing Worker Engine :)

 

im not good with Quests and all i can do in quest is

" Go here " " Kill Him " " Find This "

 

but with scripts im much better... lel xD

i just was w8ing too long :P

 

 

 

but here is my other Question... how about Script Attached to NPC with RegisterForSingleUpdateGameTime?

 

normaly i was using UnregisterForUpdateGameTime on Event OnCellDetach

and hope it was stoping this RegisterForSiggoings ....

 

 

but if i left NPC with this Script it will be fine?

 

and other Question... what if any player got perfect idea to make 1000 workers?

we will have 1000 scripts refreshing each hour... it may crash game? :P

 

event better cause i want to add little Sims in Skyrim :)

so NPC will become Hungry Thrist Tired etc. so they will go back to home if needed :P

 

also they will earn gold from player for work so yeee...

 

registerfor 30 sec update may be bad idea :P

but best option xD i can move NPCs without AiPackages and im gonna try it :D !

 

 

this would be INSANE great idea if NPC have to keep his stats in good state even better if he have Family :D wow

and also FINALY WORKING TRADING SYSTEM XD

not only Player Buy / Sell stuff but NPC too :D

 

lel... that only one part of my mod :)

maybe thats why my mods always crash game xD

 

but no1 is hurt cause only 100/200 ppl are allowed to download my mods and then its deleted so i dont care about crashes xD

sometimes even faster admins delete my mods xDDDD

 

 

 

sry 4 my potato english xD

 

 

ok Short version:

1) Register for Update, how about this? safe with 200+ W8ing Updates each 30 sec?

2) Event OnUpdate() will work even if player is not in cell ? or in this same world ?

Posted (edited)

You asked: "Event OnUpdate() will work even if player is not in cell ? or in this same world ?"

YES! That makes it complicated to find out, why (the hell) game is sometimes crashing immediately after player is fast travelling.

 

About your first posting, I absolutely agree with foamyesque: "the actor needs to be enabled first, because disabled actors don't run packages, and so trying to move it to its package location is referring to a thing that doesn't exist."

 

next file is part of quest MS11, if you read the code, you'll see there is no enable before, that could be the reason why this quest is so squishy.

MS11CheatStalkTriggerScript

  Reveal hidden contents

 

 

anothe sample is a Hearthfire script:

BYOHKidsAttendWeddingMarker original

  Reveal hidden contents

 

 

BYOHKidsAttendWeddingMarker changed a bit

  Reveal hidden contents

 

Edited by ReDragon2013
Posted (edited)

Quests don't need to be actual quests; they're used to do all sorts of other things.

 

Aliases are by far the most flexible, fastest, and most powerful way to find objects in Skyrim. They're also the safest way to modify things, such as by adding scripts to them or altering the package stack of actors. They're a very potent tool.

Edited by foamyesque
Posted

I don't know how to use Quests...

All i can do with Quests are most simple things like go here kill him etc.

 

 

 

Why my spell activate OnHit Event 2 times in 1 shot ? xD

Posted (edited)
  On 4/1/2019 at 9:42 PM, TobiaszPL said:

I don't know how to use Quests...

All i can do with Quests are most simple things like go here kill him etc.

 

 

 

Why my spell activate OnHit Event 2 times in 1 shot ? xD

 

OnHit fires a lot. It will trigger for anything hitting the object (a spell projectile, a weapon hit, etc), and then for each and every magic effect applied as a result. Concentration spells will do this every tick. What you're seeing is one event from the spell hitting, and another from the magic effect hitting.

 

As far as quests go, what I'm saying is: It's something worth learning about because it will let you do a lot of useful things.

Edited by foamyesque
Posted (edited)

Bfff...

 

Script:

 

  Reveal hidden contents

 

its nooooooooooo ohh w8...

i have idea... but can't test it so il will just ask xD

 

MagicEffect and Spell can be casted at same time???

 

maybe Magic effect cast his OnHit effect

and Spell cast his OnHit effect xD idk

 

So maybe

If ( ( QAgr != QPlayer ) || ( QSrc != QSpell as Spell ) )

will work... but like i said can't test it now xD

 

//Edit:

lel now reading this script i see another misstake xD

what if player don't have enough gold ? :P hehe xD

Edited by TobiaszPL
Posted (edited)

Do not think so complicated, make it short and simple.

your sample as follow:

  MiscObject PROPERTY Gold  auto
  Spell   PROPERTY mySpell  auto
  Message PROPERTY QBuyMenu auto

  Int  PROPERTY myCost = 100 auto    ; [default=100]
  Bool IsYour = False


; -- FUNCTION --

;----------------------
FUNCTION ShowMainMenu()
;----------------------
ENDFUNCTION


;=============================
State WaitForPlayer
;==================
EVENT OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, Bool IsPower, Bool IsSneak, Bool IsBash, Bool IsBlock)
;IF (akSource as Spell)
IF (akSource == mySpell as Form)
ELSE
    RETURN    ; - STOP - /1    not affected by this spell (property declaration)
ENDIF
;---------------------
IF (akAggressor == Game.GetPlayer() as ObjectReference)
ELSE
    RETURN    ; - STOP - /2    was not hit by the player
ENDIF
;---------------------
IF ( IsYour )
    ShowMainMenu()
    RETURN    ; - STOP - /3
ENDIF
;---------------------
IF (akAggressor.GetITemCount(Gold) < myCost)
    Debug.Notification("Not enough gold!")
    RETURN    ; - STOP - /4
ENDIF
;---------------------
    IF (QBuyMenu.Show(myCost) == 0)    ; Zero depends on options [Yes/No] or [No/Yes], one has 0 the other has 1 as return value, that you need
        IsYour = TRUE
        akAggressor.RemoveItem(Gold, myCost)
    ENDIF
ENDEVENT             ; /5
;=======
endState
Edited by ReDragon2013
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...