Aller au contenu

Photo

New Designer, trying to script, need help on a couple things.


  • Veuillez vous connecter pour répondre
18 réponses à ce sujet

#1
astindextor

astindextor
  • Members
  • 37 messages
 I've just gotten into using the toolsets within the last couple months or so. I used to use the old (ancient by now) Forgotten Realms Unlimited Adventures system (FRUA) which was the same idea from about 1991 that used teh engine from the old goldbox games. I got used to taht eventually, so I expect I will get more comfortable with Aurora with time as well. So far I love it. I have like three designs on the go and have never beenhappier.

But there are a few scripting related issues I am having trouble with. There are lots of tutorials out there, but in some ways there are too many. I am having trouble looking up specific things, even in the searchable places like the wikis and the vault. A couple specific scripts I want include:

- A script for dancing NPCs. I have a tavern with a clear space that I want to populate with dancing NPCs. For some reason I can't seem to figure out what the script should be. I tried using the ScriptAssist and filling int he blanks but it tells me ERROR: FUNCTION DEFINITION MISSING. I assume it means I need to specify who is dancing, but I am still not clear on the phrasing for how it works.

- A script to make the PC walk to the speaker instead of vice versa. I have an NPC that the PC must speak to. I have used a bunch of palceables to create an effect around the NPC. I can get a cutscene to start just fine. But I don't want the NPC to move beause if he does, it ruins the illusion that the placables are part of the NPC. I tried setting the NPC to be immobile, but this caused the scene to stick because it was waiting for the NPC to walk up to the PC. I used a waypoint and had it set to make the PC walk to it, but I then have to have the conversation be a seperate event. So basically PC enters room, cut scene makes PC walk up to a point, then the player has to click on the NPC to actually begin the conversation. Its not the end of the world, it was justfrustrating trying to get it to stick.

- Storms of Zehir style party creation and overland map; I loved both of these inSoZ. I downloaded the tutorials but they are missing steps. Is there a fill in the blanks type script I can download, or even just a bas starter module that is set up to easily use these?

Basically I am very comfortable with making maps. I have finally within the last few days clicked on running conversations and using the Journal (FRUA had a similar thing to the Journal with Quest STages; at first it was weird getting used to the differences in how they work, but now I really like the Journal over the old Quest STage events). I even have voice acting down (though it would be nice if I didn't need to have hundreds of .WAV files making my override folder a hot mess (would the game still find the .WAVs if they were in subfolders?). Basically if there is a form to fill out, I can do it. But any time i have to actually enter anything into the ScriptAssist directly, I am lost. Any help is greatly appreciated, and I promise to get better! lol

#2
kevL

kevL
  • Members
  • 4 061 messages
> Aurora

Are we on the same page here? NwN2 uses the Electron toolset

> ERROR: FUNCTION DEFINITION MISSING

if you really want to script, dL Skywing's AdvancedScriptCompiler - it contains both a plug-in and standalone compiler, and gives much better error messages.

- function definition missing prob. means the compiler can't find the function definition ;) You might need to reference an #include file at the top of your script, ( i don't understand that gibberish either )


ga_* scripts are stock scripts for use in conversations; try ga_move using "$PCSPEAKER" for sTagOverride
gc_* scripts are conditional scripts for conversations, btw.

note: apart from ScriptAssist to help search for functions, remember to use OpenScript/Conversation from the File menu -- the dialog has a filter that can search for stock scripts. If you install and open E.C.'s Super Include! it gives the ScriptAssist access to a thousand more function definitions ( though i don't recommend using those functions arbitrarily, some of them were written for NwN and don't work right in NwN2 : searching through The Common Scripting Library gives access to more robust functions (url subject to change w/out notice :)



Party creation & Overland map are more intricate and require various properties to be set on the campaign and on areas, that work in conjunction with scripts and Gui's ...


goodLuck, sir

Ps. almost forgot: NWN2 Toolset Notes and of course the still relevant Lexicon

Modifié par kevL, 22 juillet 2012 - 12:09 .


#3
Morbane

Morbane
  • Members
  • 1 883 messages
If you are indeed referencing the NWN2 toolset try this script in an NPC's heartbeat:
void main()
{
PlayCustomAnimation(OBJECT_SELF, "dance01", TRUE);

}

#4
Morbane

Morbane
  • Members
  • 1 883 messages
Oh, subfolders do work in the override.

#5
astindextor

astindextor
  • Members
  • 37 messages
Wow thanks for the replies. Yeah, I guess I got confused. I thought it was still called Aurora, my bad. And thanks Morbane for the script, that was exactly what I needed. Unfortunately, mere seconds after cliking to run the module from a waypoint to test the new area I had just made, there was a power outage that seems to have corrupted my module entirely.

#6
MasterChanger

MasterChanger
  • Members
  • 686 messages

astindextor wrote...

Wow thanks for the replies. Yeah, I guess I got confused. I thought it was still called Aurora, my bad. And thanks Morbane for the script, that was exactly what I needed. Unfortunately, mere seconds after cliking to run the module from a waypoint to test the new area I had just made, there was a power outage that seems to have corrupted my module entirely.


Sorry to hear that. My absolutely first two pieces of advice for anyone starting to work in the NWN2 Toolset are these:

1) Turn off auto-save. The toolset will probably try to save at some point while you are working on something that prevents it from saving (like using some kind of wizard) and this will corrupt everything.

2) Work in Directory Mode: When first saving your module click Save As Directory. After this you should just click Save. Now you'll have a module directory that contains a regular list of files like you're used to instead of rolled up into one dumb, easily-corrupted file. Note that if you want to back up your work (and you should) you should copy and paste the folder in Windows Explorer rather than Saving As a new directory (which will just move rather than copy your directory).

I'm kind of amazed that no one has yet created a Directory Mode page on the wiki, Leads to a lot of re-explanations...

Hopefully these will reduce your Toolset frustrations and keep you coding longer!

#7
kevL

kevL
  • Members
  • 4 061 messages
if the toolset is captivating enough, you'll find ways to work around how finicky it is (barring random power outrages ;)

maybe your module can be salvaged, party or entirely, with tani's Packer or sheer persistance. If you haven't done so already, be sure to turn AutoSave off in the options, and work in directory mode (SaveAs directory ... then just Save after that)


use backups and develop a backup plan. preferably to a 2nd hard drive or external device. which reminds me ... perhaps a little batchfile, because the TS has 1001 ways to migrate




[ edit @ MC ] Lol

Modifié par kevL, 22 juillet 2012 - 06:00 .


#8
astindextor

astindextor
  • Members
  • 37 messages
The links have a lot of information, but it all seems to be based on some assumptions as far as my understanding before going in. Here is an example:

I want to include party creation a la Storm of Zehir in a module. So I read through the .PDF and it says that all I need to do is include this script:

DisplayGuiScreen(oPC, "SCREEN_PARTY_GEN", FALSE, "partygen.xml");

Well, that script doesn't work, and neither does incluyding void main {} around it.

The tutorials assume I know how to fill in the blanks, but I really don't. I even tried looking under the hood in a module I downloaded that had party creeation (Icewind Dale) and all it had was a custome script that I couldn't actually figure out how to open and look at. I can get this stuff once I see a full script in front of me, but this was why I couldn't get much done at all in the old NWN toolset: the script templates weren't clear on how to fill in the blanks.

#9
Dann-J

Dann-J
  • Members
  • 3 161 messages
You would have to define what you mean by oPC in a way that the script would recognise. It'd be something like:

void main()
{
object oPC = GetFirstPC();
DisplayGuiScreen(oPC, "SCREEN_PARTY_GEN", FALSE, "partygen.xml");
}

#10
Morbane

Morbane
  • Members
  • 1 883 messages
astindextor - the stuff in SoZ is a bit advanced for beginning builders - it may be good to experiment in a smaller scope - look at some older modules that are based further in the past than say IWD which is quite advanced.

Murder in Dunlop is what got me started (Alupinu) I had to see if I could do it too - modding & building

There are other small modules that have heaps of good stuff to see working to get that insight I just cant remember all of then atm.

Keep at it - the rewards are many once you find a method to channel your creativity

also look at posts from like a year ago - many of those address many now "common" issues to those that have been building the whole while

#11
astindextor

astindextor
  • Members
  • 37 messages
Dann-> Thanks very much!

Morbane-> I'll look into those for sure. Don't get me wrong, I didn't mean to come across liek I was complaining. I was just trying to put into words what was causing me difficulty.

#12
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Scripting for Noobs

Also take a look at the various links in the sticky at the top of this forum, but process what is at the above link first.

( you can also read documents on general programming, nwscript is basically C in how it's setup, just a simpler set of options )

#13
kevL

kevL
  • Members
  • 4 061 messages
after Scripting for Noobs, the NwN Lexicon - which is downloadable as a handy Help.CHM file - has a series of "Beginning Scripting" tutorials that can take a scripter well into intermediate level

motto: it takes thyme to make it rime,

#14
Morbane

Morbane
  • Members
  • 1 883 messages

astindextor wrote...

Morbane-> I'll look into those for sure. Don't get me wrong, I didn't mean to come across liek I was complaining. I was just trying to put into words what was causing me difficulty.


Didnt mean to condescend - just offering a more doable perspective so you dont loose faith - NWN2 toolset can make hours and hours days and months of creative enjoyment:innocent:

Modifié par Morbane, 23 juillet 2012 - 08:15 .


#15
astindextor

astindextor
  • Members
  • 37 messages
Here's a weird point. That dancing script worked on the module that got corrupted (and thus lost). Started over, and now it doesn't work anymore. Like, at all.

#16
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 592 messages
For dancing NPCs you can use the script I use in Harvest of Chaos posted here.

For the SoZ Party editor to work you only need to have SoZ installed, and set a couple of campaign settings. You can use my Deck of Trumps item (see the Silverwand Sundries in the vault) to open the menu. Explanation is posted with the item.

Regards

#17
Morbane

Morbane
  • Members
  • 1 883 messages
Did you remember to manually put the script in the heartbeat? Just askin because things get forgotten all the time...

#18
Morbane

Morbane
  • Members
  • 1 883 messages
Or remember to compile the script?

:)

#19
astindextor

astindextor
  • Members
  • 37 messages
Actually, it was even dumber. I just pasted it into a blank script instead of adding it to the OnHeartbeat script. Fixed. And super thanks. I've kept it as a template for all kinds of animations