Learning script, I need an explanation
#26
Posté 21 septembre 2010 - 08:38
My function creates a heartbeat, which runs a script named "TG_EnviroControl.nss" every round. It just has to be run on module load, but it can be run almost anywhere or even more than once, it only allows one heartbeat to be created.
You just add the line to any event really to start it up.
CSLEnviroGetControl( );
I use onmodule loaded, but this allows you to just attach this to whatever script you want. This allows you to add any heartbeat you want without messing up the heartbeat attached to the module. This allows adding features to even a locked module like mysteries of westgate if you can get a single script of your own to run.
No most folks are not modding the OC, unlike most games we can do original things better than the modules that ship with the game. It requires more knowledge as to how things work since you need to modify things from the outside really, you don't really want to redo the actual modules and release those.
#27
Posté 21 septembre 2010 - 08:52
Yes.Vaalyah wrote...
From what I've understood, whatever thing in the game has a ht script. Something that simply "counts" the time that pass by. So I can trigger some events with it. ie: I tie a script for "doing something" to the hb script of an item. When the hb script verifies that some conditions have been satisfied (and this check happens every 6 seconds), then my script (the "doing something") starts.
Is it correct?
I haven't seen a mod that attempts to add additional dialogue except for ones that add to existing dialogue. My own mod - the OC Makeover SoZ Edition - makes many modifications to the OC, but I did not do anything to add additional dialogue at various times using heartbeat scripts. I did make some changes to companion dialogues though.By the way, two questions:
1) from what I am reading, it seems to me that no-one has ever tried to modify the game in this way, is it correct?
I do not think it would be feasible to add new companions into the OC. The OC is heavily dependent on the provided companions and there is code all over the place that assumes who the companions are in the party. It was a significant effort just to make Shandra act as a full companion all the way through in the Makeover. The Universal Companion mod lets you add in your own companion, and the Makeover adds the SoZ Party Creation feature to the OC, but those aren't really for adding in full-blown companions that interact with other companions in the game.2) BG series modders have added thousands of NPCs to the OC... I suppose it is impossible to do the same for NWN2... or not?
The NWN2 OC is a lot more restrictive in nature than BG was. You would have an easier time adding NPC's into SoZ than the OC or MotB, because SoZ is less restrictive about companions. SoZ is far more like BG.
What pain's script shows is that you can add a heartbeat script to an object from another script. Something I hinted at but have never done. If you decided to use area heartbeat scripts, then you would be able to have a script like the area onEnter script add your custom area heartbeat script to the area.
If you use the module heartbeat or companion heartbeat scripts then this wouldn't be needed.
Regards
#28
Posté 22 septembre 2010 - 03:49
So I would like to thank you very much for all your patience and... well, I would come back after having read some more things around, just to improve and being able to understand a bit more!
Thank you very much! ^^
#29
Posté 22 septembre 2010 - 06:13
Just a side note, the very first thing i wanted to be able to do in script was make fireballs vary by damage type and visual effect, that was probably 3-4 years ago. ( i had only done icons before that )
It was a bit over my head at the beginning, but i focused on doing some other things since i could not figure out how to do that. Since then i've redone a lot of core system, and only in the last year i even implemented elemental substitution into all my spells, but even then i've not added the modes and feats so players can access that, right now only certain monsters take advantage of it. I just don't know how everything works yet, well not enough to make my own modes in a reliable manner.
Quite often i see those completely new stating problems they want to tackle which would be a huge challenge if they are even possible to the most skilled scripter. It is just overwhelming to learn how to script, learn the engine, and implement something which the game just not ever made to do at the same time.
So some things you might want to do, you might want to tackle smaller projects until you learn enough to handle them, even volunteer to help a PW or SP module maker get their scripts working. I try to focus on things which i "need to learn" almost all the time. Just the act of learning will actually get what you need done far faster than solely focusing on a single project. Once you "learn" the implementation of something tends to just fall into place very quickly because the issue is more "how" to do it, than doing it. So many have stated they don't have time to learn, when my experience is if you focus on nothing but learning you save far more time in the long run.
Also, in the beginning, if you just read thru the scripts, study how they work, and do minor tweaks, being careful to test them. This is things like changing a damage amount, or perhaps making a spell like drown remove the effects of a spell like combust. You can do many of the same things in the AI or in the campaign scripts, just make sure to comment ( those /* */ things ) what you changed with the original there in case you need to put it back. Then do a lot of testing in game so you can learn how things work.
Note that this is not just the scripts that come with the game, but the scripts by other established scripters as well, you learn a lot by just seeing what people are doing, the scripts that come with the game are not the best examples of the best way to do things.
There is no path to learning scripting, the trick is just keeping at it. After you get some headway, and even if you are getting good, go reread a basic tutorial like knightmares, it's only when the theory and your experience click together that you will really understand how to script. You never are going to stop having ahah moments, nor will you stop learning things from others, even folks who are just starting out. If something seems like its not getting progress, put it down and come back to it after you learn some more, and you really want to come back to your initial projects and redo them once you get more accomplished.
Modifié par painofdungeoneternal, 22 septembre 2010 - 06:43 .
#30
Posté 22 septembre 2010 - 09:23
They have suggested to me to install DirectX9 and .NET. I'll do a try.
Let's suppose the toolset would then work. At that point I would simply have a random try in doing stupid and silly things, like creating an outdoor area, add plants, colouring a path, put an NPC... After a while like that I would try for indoor areas and then with dialogues. No plot, no cause-effect, just random try.
For the point I will feel secure with my basic building abilities, I should have read a lot of things about scripting, so I could be able to start adding extremely basic scripts to my areas. And maybe I'll be able to understand all your suggestions :-D
Then I would like to join somewhat project, because I need to learn and practice a lot. At first with easy things, then I could grow in difficulty. This just to say: "don't worry, I am not totally crazy, I know that I have to start from the base" :-P
#31
Posté 23 septembre 2010 - 03:44
#32
Posté 23 septembre 2010 - 04:27
#33
Posté 24 septembre 2010 - 03:06
My signature leads to a vault page with some content I made - as well in many others' signatures. . .
Modifié par Morbane, 24 septembre 2010 - 03:08 .
#34
Posté 24 septembre 2010 - 03:25
#35
Posté 24 septembre 2010 - 06:44
Vaalyah wrote...
Ehm, no, I know what the vault is. I mean, what is "lilac soul's script generator"! :-P
It is a tool for generating NWN scripts. It is here. I've never used it myself, but others do and the scripts it generates are often NWN2 compatible (although not always).
Regards
#36
Posté 24 septembre 2010 - 08:40
By the way, since my computer with NWN2 is still unavailable till my new gpu comes back, is there a place where I can read the scripts that come with the game? Thank you.
#37
Posté 24 septembre 2010 - 09:42
Vaalyah wrote...
By the way, since my computer with NWN2 is still unavailable till my new gpu comes back, is there a place where I can read the scripts that come with the game? Thank you.
Between nwnlexicon and nwn2wiki you should be able to find an explanation, and examples of every scripting function that ships with the game until you can access your toolset again.
For the actual scripts themselves, try the community script library, I think it has some if not all of them. Not positive.
Cheers.
#38
Posté 24 septembre 2010 - 10:23
#39
Posté 25 septembre 2010 - 05:23
Erithol wrote...
For the actual scripts themselves, try the community script library, I think it has some if not all of them. Not positive.
Cheers.
If you are referring to Pain's CSL - it is a custom foundation built with enhanced... well just about everything for PWs.
My suggestion is the NWNLexicon 1.69 - it was redesigned specifically for NWN2 where the 1.68 was really only for NWN1
Lilac Soul's Script generator - IMO is THE best way to learn basic scripting and even a good bit of more advanced stuff as well (like tag based scripting). FYI it actually asks you what you want to do, then generates a script ready to be pasted and compiled in the TS!
:innocent:
Modifié par Morbane, 25 septembre 2010 - 05:25 .
#40
Posté 26 septembre 2010 - 02:52
#41
Posté 26 septembre 2010 - 03:12
Vaalyah wrote...
Is there a link to this script generator, please? (I have a really bad internet connection today)
Lilac Soul's Script Generator.
Works great, but is a bit limited. Don't expect to do anything really complex or build scripted systems and the such. Occasionally it will output a finished script that does not work in NWN2, usually because it calls on an include script that is in NWN1 but not NWN2.
#42
Posté 26 septembre 2010 - 03:34
I don't want to use it extensively, but just to have some example of scripts! Since I am learning... :-)
#43
Posté 26 septembre 2010 - 09:27
DERP nevermind, someone already said it
Modifié par Nightwoe, 26 septembre 2010 - 09:28 .
#44
Posté 26 septembre 2010 - 09:31
#45
Posté 26 septembre 2010 - 09:37
#46
Posté 27 septembre 2010 - 12:30
Nightwoe wrote...
uhh...I've done a few things I would never have figured out without it...I had a complicated torture- uh, I mean INTERAGATION scene (hehe...>.>;that needed multiple animation, movement, tag-to-tag associations, equipment changing, PLUS a huge explosian involving a section of the wall while simultaniously spawning like 15-20 NPCs running through script generated smoke(the smoke never worked, though T_T)
Sure, you can use the Script Gen to have a script do "numerous" things all in the same script, but getting it to do "complicated" things is another matter. Eventually you will find that the program has a limit on what it can do and from there you will need to learn how to do it for yourself. All-in-all though, an excellent tool, its what taught me to script.
#47
Posté 27 septembre 2010 - 08:43
So, in case someone here has already done something in that direction, please, let me know! I have tons of things to learn!





Retour en haut






