How Can I Set Chargen Player To Have A Disease?

Post » Fri May 27, 2011 11:31 am

As soon as the game starts (talking with Jiub on the slave ship) I want my character to be infected with a common disease. Although none of my stats are set at the point. Well, can someone help me out with this? Can I make a new disease name? Like Nox Vomica from Daggerfall?
User avatar
Lynette Wilson
 
Posts: 3424
Joined: Fri Jul 14, 2006 4:20 pm

Post » Fri May 27, 2011 7:39 am

you could put an activator in the path of the player as he comes off the ship with a script like:
begin playerdiseasescriptshort doonceif ( player -> getdistance = 250 )  if ( doonce = 0 )     player -> addspell "nox vomica"      set doonce to 1  endifendifend 


pretty basic, but its a start XD
User avatar
Louise
 
Posts: 3407
Joined: Wed Nov 01, 2006 1:06 pm

Post » Fri May 27, 2011 5:46 am

That's giving me an error. When I start a new game, it says script error : EXPRESSION in playerdiseasescript.

begin playerdiseasescriptshort doonceif ( player -> getdistance = 250 )  if ( doonce = 0 )     player -> addspell "nux_vomica"      set doonce to 1  endifendifend 


I went in the spellmaking tab and made the disease "nux_vomica". Then I added this script to Player, and I get that error message. And apart from that error, how can I get this disease to start automatically at startup? I mean, isn't there a command you can put in the script that'll make it start right away, before you even leave the ship?
User avatar
katie TWAVA
 
Posts: 3452
Joined: Tue Jul 04, 2006 3:32 am

Post » Fri May 27, 2011 9:05 pm

The error is in the GetDistance check: the equal operator is ==, not =.

I would recommend adding the AddSpell command to the CharGen script. If for some reason that doesn't work, put the script on an activator you make and place the activator somewhere along the player's path. Change "GetDistance = 250" to "GetDistance <= 250" as well.
User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Fri May 27, 2011 6:39 pm

The error is in the GetDistance check: the equal operator is ==, not =.

Well, it might be that, but I think more likely the problem is you are trying to find the distance between the player and him/herself. You write that you have attached this script to the 'player' NPC in the construction set. I would recommend against that on general principles alone.

Matt's (good) advice was to place the script on a hidden activator and that is the best place for it. There is also the matter of checking for a distance of exactly 250 units (a near impossibility). You would want to check perhaps less than or equal to (although this is a very short distance). Moreover I do not see the necessity of a distance check anyway. You write that you want the disease to be assigned when the player is speaking with Jiub. Place the activator in the same cell with the activator and it will add the disease in the first frame if that is acceptable. Here is your revised script:

Begin PlayerDiseaseScriptshort doOnceif ( doOnce >= 1 )   returnendifplayer->AddSpell "nox vomica" set doOnce to 1End PlayerDiseaseScript

User avatar
CHARLODDE
 
Posts: 3408
Joined: Mon Apr 23, 2007 5:33 pm

Post » Fri May 27, 2011 4:40 pm

Cyran0, the error is gone, but now when I start a new game, I have no disease. All my stats are normal.

Here is a picture of everything so you can help pinpoint the problem. I've put the tavern sign activator right beneath the floor below Jiub. I changed it's ID and made it a new object, though. For some reason, the spell isn't working. :confused:

http://img51.imageshack.us/img51/9513/activatorj.jpg
User avatar
Tracy Byworth
 
Posts: 3403
Joined: Sun Jul 02, 2006 10:09 pm

Post » Fri May 27, 2011 9:38 am

It is not the fault of the script, but the chargen process. Until the player has a stats menu there are no attributes for the disease to affect, and until the player has a magic menu the spell effects icon will not display in the lower right corner. The former does not exist until after the player has chosen a class in dialog with Sacucius Ergalla, and the latter is not activated until after the player takes Fargoth's ring from the barrel. After a bit of testing and using the console to add a disease, adding the spell after speaking with Sacucius Ergalla is the best solution.

You could tweak the chargen scripts (not recommended by me), look for some other flag that is set just after speaking with Sacucius Ergalla (I am not certain one exists) or check for the player's position in the cell with Sacucius Ergalla. The lattermost will introduce a short delay between the time the player has a stats menu and when his/her attributes will be affected by the disease (assuming the player checks the stats menu during that time). However if you can live with that it is the easiest to implement. The player has to pass through the door and hall leading from Sacucius Ergalla. Place the hidden activator in his cell with this script:

Begin PlayerDiseaseScriptshort doOnceif ( doOnce >= 1 )   returnendifif ( ( player->GetPos y ) >= 300 )   player->AddSpell "nox vomica"    set doOnce to 1endifEnd PlayerDiseaseScript

User avatar
Alina loves Alexandra
 
Posts: 3456
Joined: Mon Jan 01, 2007 7:55 pm

Post » Fri May 27, 2011 8:30 pm

Actually, the script that I have makes the NPCs in the interior of the slave ship respond as if I have a common disease. Like, they say "go get healed" and stuff. But when I'm done with chargen and am just playing the game normally out in Seyda Neen, I don't have it. But what I did was add a little line of script to Socucius Ergalla's dialogue so that after I've clicked on my Identification paper scroll, I just click on him and he says "Be gone child. And for Azura's sake, go get healed. You look like you've got brainrot." And then in the comment box I have player - > addspell "nux_vomica", 1. And it works. After taking the paper is when my stats box is viewable and it's also when the disease can start. But the guards in the prison ship reacted to me as if I had it already. So it all works out great.
Thanks.
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm

Post » Fri May 27, 2011 8:42 pm

But now I have a new problem. When I go back into the Census and Excise office a few days later, or any time later really, Socucius Ergalla's first line of dialogue is still "Be gone child. Go get healed..... etc" and I still get that Nux Vomica spell added to my inventory. How can I set this particular line of dialogue so that it only happens once in the game and that it's also a force greeting? Like, after I've collected my Identification Papers, I want that dialogue box to pop up. Then I click my answer and the spell is added to my inventory (like what it does now). But if I go see him later or talk to him after that, I'll just get his usual dialogue like "what do you want?" and all that?
User avatar
Sami Blackburn
 
Posts: 3306
Joined: Tue Jun 20, 2006 7:56 am

Post » Fri May 27, 2011 4:31 pm

I am not certain I understand exactly what you are doing. It appears you have created a new greeting for Sacucius Ergalla through which all this magic is accomplished. The easiest way to make it do-once is to declare a global short variable (flag) to toggle. Add a dialog filter to the greeting that adds the disease that checks for Global: diseaseAdded = 0 (or whatever you name the variable). Have dialog results set diseaseAdded to 1 and you will never read that greeting again.

Your solution puts me in mind of a less invasive and more sure-handed approach by not depending upon the player to initiate dialog with Sacucius Ergalla a second time. Place a hidden activator anywhere in the cell with this script:

Begin PlayerDiseaseScriptshort doOnceif ( doOnce >= 1 )   returnendifif ( ( player->GetItemCount "chargen statssheet" ) >= 1 ) ; player has identification papers   player->AddSpell "nox vomica" ; disease added   set doOnce to 1 ; will not happen againendifEnd PlayerDiseaseScript

This will add the disease at the moment the player picks up the identification papers and only once. You can still have a special greeting for Sacucius Ergalla that comments on the player's health, but it will not actually add the spell. That same script can be used to have Sacucius Ergalla force greet the player (perhaps after a short timed delay so it is not immediately as the player takes the papers). Such a script might look like this:

Begin PlayerDiseaseScriptshort doOncefloat timerif ( doOnce >= 2 )   returnendifif ( menumode == 1 ) ; required for timer to work   returnendifif ( doOnce == 0 )   if ( ( player->GetItemCount "chargen statssheet" ) >= 1 ) ; player has identification papers      player->AddSpell "nox vomica" ; disease added      set doOnce to 1 ; will not happen again   endifelseif ( doOnce == 1 )   set timer to ( timer + GetSecondsPassed )   if ( timer < 0.5 ) ; short delay      return   endif   set doOnce to 2   "chargen class"->ForceGreeting endifEnd PlayerDiseaseScript

I suggest you filter the new greeting for Item: chargen statssheet >= 1. This assures that greeting will not be available after the player has spoken with Sellus Gravius (since he removes the identification papers).

This puts me in mind of a different solution for your original problem (although it still requires that the player voluntarily speak with Sacucius Ergalla again). Filter the greeting that adds the disease for Item: chargen statssheet >= 1. This will assure that the greeting will not be available after the player speaks with the captain (assuming another mod does not mess things up by adding a second reference to the game of the identification papers).
User avatar
Jynx Anthropic
 
Posts: 3352
Joined: Fri Sep 08, 2006 9:36 pm

Post » Fri May 27, 2011 7:53 am

Thanks! It works perfectly.

There's something else I want to fix in the chargen sequence. Right after I'm talking to Jiub, the guard comes in and says "this is where you get off. Come with me." And then I'm able to move and follow him. Well, right after he says that, I want the other prisoner that's standing next to Jiub (there's another one back there with me and Jiub) to initiate dialogue with me.

I already have it set up to where he only says it once and then I can't initiate dialogue anymore with him after that, which is how I want it. But I want it to where I don't have to click on him after the guard has finished talking to me. I need to add a ForceGreeting in there but I'm not sure where to put it or what state to set it to. How should I alter this script so that it happens after the guard is done talking to me and I'm able to move?


Begin ICMQ_Chargen_Rapistshort noloreshort greetonceif ( MenuMode )	returnelseif ( onactivate )  ;this triggers when you click on him	if ( greetonce == 1 )  ;already done once so don't activate		return	else		set greetonce to 1		activate	endifelseif ( GetDisabled == 0 )	if ( CharGenState == -1 )		disable	endifendifEnd

User avatar
lydia nekongo
 
Posts: 3403
Joined: Wed Jul 19, 2006 1:04 pm

Post » Fri May 27, 2011 5:17 pm

Here is a script (to be place on the new prisoner) that checks for a state in the Chargen Guard's script - it is after the guard orders the player to follow him and the movement instructions are displayed. The menumode check will mean that the script will wait until after the player has clicked [ok]. The timer gives a short delay (adjust to taste) before the ForceGreeting. You specified a forced greeting, but you might consider either a voice file to be in keeping with the other interaction with the player at this point of the game, or at least a messagebox. Either can be substituted in place of the ForceGreeting in the script.

Begin PrisonerForceGreetshort noLoreshort doOncefloat timerif ( doOnce == 2 )	returnendifif ( menumode == 1 ) ; required for timer to work	returnendifif ( doOnce == 0 )	if ( "chargen boat guard 2".state == 40 )		set doOnce to 1	endifendifif ( doOnce == 1 )	set timer to ( timer + GetSecondsPassed )	if ( timer < 0.7 ) ; short delay		return	endif	set doOnce to 2	ForceGreetingendifEnd PrisonerForceGreet

User avatar
Lewis Morel
 
Posts: 3431
Joined: Thu Aug 16, 2007 7:40 pm

Post » Fri May 27, 2011 12:09 pm

Thanks. It works great. I adjusted the timer to 4.0 so at least Jiub gets a chance to say "You'd better do what they say" before the dialogue initiates. But I can still click on the other NPC and the same dialogue box comes up.
How do I incorporate the Greet Once script into this script here? I just want to talk to him once and if I try clicking on him again, I don't want the dialogue box to pop up.
User avatar
Austin Suggs
 
Posts: 3358
Joined: Sun Oct 07, 2007 5:35 pm

Post » Fri May 27, 2011 6:11 pm

In the beginning, insert the following:
if ( OnActivate == 1 )endif

User avatar
James Shaw
 
Posts: 3399
Joined: Sun Jul 08, 2007 11:23 pm

Post » Fri May 27, 2011 1:31 pm

Thanks! That was incredibly easy. It works perfectly.

There has been this one problem with Immersive Chargen that I could never figure out. Why does the guard not look at me?

http://img260.imageshack.us/img260/6248/screenshot12d.jpg

Oh, and apart from that, is there a way to make those ropes hanging from the ceiling with the hooks sway a little?
User avatar
lexy
 
Posts: 3439
Joined: Tue Jul 11, 2006 6:37 pm

Post » Fri May 27, 2011 6:13 pm

Nope. They are statics, not activators (not to mean that they'd have to have Idle animations in their nifs, which they don't, so a complex and tedious script with plenty of Move would have to be in order). In short, theoretically you *could* replace existing ropes with your own models that would behave as you desire, but the amount of necessary work makes it an effort disproportional to the outcome. Unless, you really, *really*, REALLY want those swaying ropes and your peace of mind depends on it.
User avatar
Chris Johnston
 
Posts: 3392
Joined: Fri Jul 07, 2006 12:40 pm

Post » Fri May 27, 2011 6:33 pm

Hehe, that's too much work for something that is so trivial. I'll pass. But why does that guard not look at me? Shouldn't his head turn to my direction?
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am


Return to III - Morrowind