forgetcanon

Conditionals - scripting with numerics

Recommended Posts

I read this tutorial but it never specified how to write a script checking for a specific numeric, not just whether or not a boolean was true or false.

 

Specifically, what I'm interested in doing is creating a global numeric like "revan_rom" and setting 0 = Revan romanced no one / Juhani, 1 = Revan romanced Bastila, 2 = Revan romanced Carth, and 3= Revan romanced both.

 

(If numerics can be double digits, I'd probably want to write it so that 00 = male Revan romanced no one, 01 = female Revan romanced no one, etc. Just to make it easier on Felix when he ends up using these scripts in Alternate Revan Romances 2.0, so he's not constantly needing to check Revan's sex, too.)

 

I'd like to know both how to script the numeric being set (probably in an early conversation with Kreia or T3), and how to script in the later conversations with Bastila's holocron / Carth + Bastila.

Share this post


Link to post
Share on other sites

The tutorial sort of gets conditionals right, but the code could be a lot cleaner.

 

What you're describing in your post is probably best done with enumeration. (1,2,3, etc)

 

No double digits however. You'd want to just make a variable for each party member, of which either of the values could be 0 or 1

Share this post


Link to post
Share on other sites

Alright, no double digits. I suppose Felix can run c_chkrevsex every time it applies, along with chk_revrom. That one's easy.
 
The problem with making a different boolean for every potential romance option is that that makes it extremely hard to make the dialogue trees in the scene with Carth and Bastila. For every time Carth mentions Revan, it'll have to check Revan's sex, and then four different booleans. Carth will have a minimum of eight different responses every time Revan's gender and romance status is brought up.
 
(And booleans wouldn't work anyway, because if Revan romanced both, that makes Bastila, Carth, and Both all True.)
 
...I still have no idea how to set a numeric or deploy it. I'm assuming I'll have to write a different script for each number I'd set it as? So it would look something like this?
 
T3: Bip bop boop drroooo.
Exile:

1. Well, Revan always was the loner type. (no script: revrom remains at 0)

2. I'm not surprised Revan fell for her. She/He always appreciated tenacity. (set_revrom_1)

3. I'm not surprised Revan fell for him. She/He always did like a military mind. (set_revrom_2)

4. I'm not surprised Revan adored them. She/He always attracted the best. (set_revrom_3)

 

(and somewhere in this coversation askt3revrom runs, setting it from 0 to 1, so you can't ask t3 about it again.)

 

Or is there an easier way to do this?

 

Whenever chk_revsex appears in a dialogue tree, in dlg editor it asks for 0 or 1. Does dlgeditor work the same way with numerics?

 

EDIT: Yes, there is. I see what you mean about the booleans, now. Next time I'll trawl tutorials a bit more.

Share this post


Link to post
Share on other sites

I'd be interested in seeing/reading how you might accomplish it then.

 

I've been wanting to release a tutorial for how to start scripting in general for awhile, but seems like a big undertaking. Probably be easier to modify existing ones.

 

It doesn't help either that I stopped being able to use kotor script editor

Share this post


Link to post
Share on other sites

So for the most part, Felix is able to check Revan's romance and sex with two scripts, so that's no problem. He runs c_chkrevsex for the pronouns and c_glob_bool_set for platonic/romantic.

 

(So, for example, a platonic Bastila will show up for a female Revan and use "she" and not say she loves her.)

But the hologram on the Ebon Hawk is giving us more trouble.

It's spawned by a script called a_createk1cnpcs, which spawns a Bastila holo for M!Revan and a Carth holo for F!Revan. I'm going to have to remake that script so it spawns Carth if Carth was romanced, else Bastila.

 

Though it's going to look more like LS Carth or DS Carth (meaning, jacket. though I may stick both holos in the jacket. I like the jacket) if Carth was romanced, else LS Bastila or DS Bastila.

 

My problem with that one is that the script didn't decompile, so I have no idea how it spawned Carth or Bastila, where they spawn, etc. It's not in the source code, either. Another conditional script that I've already worked out (c_chkrevsexend) tells the holo what lines to speak, but it's spawning the holo itself that is giving me issues.

 

Should I make a new thread for that problem, or keep posting in this one?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.