Quick Questions -- Quick Answers, The 27th

Post » Sat Feb 19, 2011 1:09 am

Making an inn, and want to rent a bed. In the CS Wiki it says to be able to make the room rentable, add the variables to the NPC.
Specifically it says
Then add the variables;

short rent         ;if you have rent the room or notshort rentday      ;make sure it's the same dayshort cleanup      ;For the Resetingshort setup        ;Check if the first part has been run


What are the 'variables' and where do I add them?
http://cs.elderscrolls.com/constwiki/index.php/Rent_A_Room_Tutorial
User avatar
JAY
 
Posts: 3433
Joined: Fri Sep 14, 2007 6:17 am

Post » Fri Feb 18, 2011 7:19 pm

Making an inn, and want to rent a bed. In the CS Wiki it says to be able to make the room rentable, add the variables to the NPC.
Specifically it says

What are the 'variables' and where do I add them?
http://cs.elderscrolls.com/constwiki/index.php/Rent_A_Room_Tutorial


You add them to the NPC's script.

Wiki links of interest: http://cs.elderscrolls.com/constwiki/index.php/Declaring_variables, http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Basic_Scripting_Knowledge, http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_My_First_Script
User avatar
Kira! :)))
 
Posts: 3496
Joined: Fri Mar 02, 2007 1:07 pm

Post » Sat Feb 19, 2011 3:09 am

You add them to the NPC's script.

Wiki links of interest: http://cs.elderscrolls.com/constwiki/index.php/Declaring_variables, http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Basic_Scripting_Knowledge, http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_My_First_Script

Thank you. :foodndrink:
User avatar
Rachel Eloise Getoutofmyface
 
Posts: 3445
Joined: Mon Oct 09, 2006 5:20 pm

Post » Sat Feb 19, 2011 1:10 am

I'm trying to create a vanilla GetGameRestarted - I remember that, if you have a bad reference, a script will run once until the bad reference, flag itself as Unholy, and never run again until you exit the game and restart. However, now that I'm actually trying to make this happen, I can't figure it out. So, any suggestions? Another possible path - vanilla function that alters a property (base object parameter, game setting, etc.) that isn't stored in the save game.
User avatar
latrina
 
Posts: 3440
Joined: Mon Aug 20, 2007 4:31 pm

Post » Sat Feb 19, 2011 7:37 am

I'm trying to create a vanilla GetGameRestarted - I remember that, if you have a bad reference, a script will run once until the bad reference, flag itself as Unholy, and never run again until you exit the game and restart. However, now that I'm actually trying to make this happen, I can't figure it out. So, any suggestions? Another possible path - vanilla function that alters a property (base object parameter, game setting, etc.) that isn't stored in the save game.


Yes! The "no xp from miscellaneous actions bug" that I just finished squashing no long ago.

Here's a script snippet:
	if ( getActiveMenuMode == 1026 )		;get reference to base object of current book/scroll		let tempRef := getActiveMenuObject		if ( tempRef ) && ( isTextInputInUse == 0 )			if ( ObXPContainerREF.getItemCount tempRef )				return			else				ObXPContainerREF.addItem tempRef 1			endif		else			return		endif...


Use form ID finder - the scroll it uses is an invalid reference. Once the script hits if (tempRef) - goodbye and it ain't running again. The fix was to change if (tempRef) to if ( isFormValid tempRef )...
User avatar
Andrew Tarango
 
Posts: 3454
Joined: Wed Oct 17, 2007 10:07 am

Post » Fri Feb 18, 2011 11:04 pm

When you put in a door or portal, how do you change it to "Door to My House" instead of just, "Door to"? (Sorry it's a noobish question, I'm pretty new to this :P)
User avatar
Sophie Miller
 
Posts: 3300
Joined: Sun Jun 18, 2006 12:35 am

Post » Fri Feb 18, 2011 5:44 pm

I have a messenger NPC that has items that the player must obtain. Do I need to make the NPC a quest item as well as the items she carries to insure the player gets them?

I do not want her to be killed by the player, then "cleaned up" out of the game as a dead body if the player has not retrieved all the items yet off the body.
User avatar
Irmacuba
 
Posts: 3531
Joined: Sat Mar 31, 2007 2:54 am

Post » Sat Feb 19, 2011 1:31 am

When you put in a door or portal, how do you change it to "Door to My House" instead of just, "Door to"? (Sorry it's a noobish question, I'm pretty new to this :P)

You have to give the interior cell of the house a name. Right click on the cell and select 'Edit'. Click on the 'Interior Data' tab and fill in the name field.

I have a messenger NPC that has items that the player must obtain. Do I need to make the NPC a quest item as well as the items she carries to insure the player gets them?

I do not want her to be killed by the player, then "cleaned up" out of the game as a dead body if the player has not retrieved all the items yet off the body.

You could make her essential so she can't be killed at all. But setting her as a quest item should ensure that her corpse won't disappear when the cell resets, if she should end up dead for whatever reason.
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Sat Feb 19, 2011 7:19 am

I've got an OnTriggerActor script applied to a bear. But when actors (other animals and humanoids) collide with the bear, the script doesn't fire. Any clue as to what could prevent that code from executing?
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am

Post » Sat Feb 19, 2011 4:21 am

Bears (er... all creatures) do not have that kind of "collision" detection. You would need to make a new creature with such collision (not recommend unless you really know what you are doing with 3d modeling and Nifskope) or better just place and drag a collision box around on the bear using get and set pos commands.

I've got an OnTriggerActor script applied to a bear. But when actors (other animals and humanoids) collide with the bear, the script doesn't fire. Any clue as to what could prevent that code from executing?

User avatar
Jesus Sanchez
 
Posts: 3455
Joined: Sun Oct 21, 2007 11:15 am

Post » Fri Feb 18, 2011 6:12 pm

Bears (er... all creatures) do not have that kind of "collision" detection. You would need to make a new creature with such collision (not recommend unless you really know what you are doing with 3d modeling and Nifskope) or better just place and drag a collision box around on the bear using get and set pos commands.


OK thanks. Xilver managed to accomplish it in Midas, applying an OnTriggerActor to his polymorphed wolf that forced it to automatically attack whenever an Actor collided with it, but his custom wolf nif might have been modified with this in mind. Come to think of it, I remember looking at his wolf nif and wondered what this bubble-looking-thing was around the mouth. Maybe that's some kind of collision-trigger zone. Probably too fancy for me to figure out :D
User avatar
Rex Help
 
Posts: 3380
Joined: Mon Jun 18, 2007 6:52 pm

Post » Sat Feb 19, 2011 3:26 am

I'm trying to create a spell that will increase the count of the equipped arrows in the Player's inventory (and only the equipped arrows). I want to make the script as generic as possible so that it will work for arrows from other mods. Is there a way to do this without OBSE?

The reason I ask is that some players don't use OBSE and I want them to be able to use this (if it will work).
User avatar
Gemma Flanagan
 
Posts: 3432
Joined: Sun Aug 13, 2006 6:34 pm

Post » Sat Feb 19, 2011 12:15 am

My latest baffling problem. So when you're mounted and attacked by something, your attacker sometimes hits you and sometimes hits your horse. I'm trying to make it so the attacker always goes after me, not my mount, no matter what, even if my mount attacks back.

I've tried various scripting tricks attached to my mount, like ...

If Mount.IsInCombat   Set MountCombatTarget to Mount.GetCombatTarget  If MountCombatTarget.GetCombatTarget != Player    MountCombatTarget.StartCombat Player  EndifEndif


But this doesn't seem to work, because as soon as my mount attacks again, then the target automatically switches back to attacking my mount. I also tried setting the mount to a ghost, but that also doesn't work, the attacker still tries to hit them instead of me. I also tried creating a faction for my mount with a disposition modifier of 100 for others in the same faction, but -100 for the Player, and make it so my enemy is added to this faction with the hope that even when my mount attacks them, they still hate me more enough to ignore the attack and go after me instead. No luck! :(

Any ideas?

Long story short, I don't want my mount to take damage or be the victim of spells, only me the rider should suffer.
User avatar
Ezekiel Macallister
 
Posts: 3493
Joined: Fri Jun 22, 2007 12:08 pm

Post » Fri Feb 18, 2011 6:33 pm

*snip*
Any ideas?

Long story short, I don't want my mount to take damage or be the victim of spells, only me the rider should suffer.

Try giving your mount a scripted ability spell with the following script:

scn DontAttackMyMountScriptBegin GameModeMountRef.StopCombatAlarmOnActorEnd


That should stop anything from attacking your mount, although you might see some weirdness from the attacker.


New question:
Is there any way to select what specific "persuasion" options will get a positive response from an NPC. For instance, I have a custom merchant and I want him to respond positively to 'Boast' and 'Joke' but negatively to 'Admire' and 'Coerce'. Any way to set that up?
User avatar
Lexy Corpsey
 
Posts: 3448
Joined: Tue Jun 27, 2006 12:39 am

Post » Sat Feb 19, 2011 4:35 am

Yes! The "no xp from miscellaneous actions bug" that I just finished squashing no long ago.
...
Use form ID finder - the scroll it uses is an invalid reference. Once the script hits if (tempRef) - goodbye and it ain't running again. The fix was to change if (tempRef) to if ( isFormValid tempRef )...

Ahh, that's right, thank you! - I need to use if instead of a function... however, I don't think I can set tempRef to a bad reference with vanilla functions :( It seems the in-game script checker looks at the explicit references (like set tempRef to cobDeleted) before running the script, so it simply doesn't run instead of running until that line. Oh well, I guess non-OBSE users will just have to suffer - it was only for a Requirements check (if you don't have OBSE, you get a warning to install OBSE or deactivate the mod... I intended to only display it once per game play, but now they get it eternally :chaos: )
User avatar
Adam
 
Posts: 3446
Joined: Sat Jun 02, 2007 2:56 pm

Post » Sat Feb 19, 2011 6:54 am

Ahh, that's right, thank you! - I need to use if instead of a function... however, I don't think I can set tempRef to a bad reference with vanilla functions :( It seems the in-game script checker looks at the explicit references (like set tempRef to cobDeleted) before running the script, so it simply doesn't run instead of running until that line. Oh well, I guess non-OBSE users will just have to suffer - it was only for a Requirements check (if you don't have OBSE, you get a warning to install OBSE or deactivate the mod... I intended to only display it once per game play, but now they get it eternally :chaos: )


Really! I admit I just got into the habit of using let instead of set because so much of my scripts require let, I use it for everything. I am surprised set detects that condition though...
User avatar
keri seymour
 
Posts: 3361
Joined: Thu Oct 19, 2006 4:09 am

Post » Sat Feb 19, 2011 3:04 am

That should stop anything from attacking your mount, although you might see some weirdness from the attacker.


Thanks, but I think I was wrong about the nature of the problem. My mount isn't actually attacking anything. It has an aggression of zero. But I've rigged the mount nif so that it has a trigger zone in front of it. And when an Actor enters that trigger zone, the script attached to the mount will force it to play an attack animation, and then an invisible activator is summoned to cast a damage spell on the Actor that triggered it. It's the illusion that the mount attacked, but it actually didn't.

And yet, creatures are still attacking my mount :(. It might be simply that when I'm mounted, my mount's body is in the way and so it absorbs whatever attack is meant for me. Not sure how to solve that.

Edit:

I'm racking my brain for a work around:
1. Is there a way to make spells, arrows and weapons pass through the mount without the mount losing all collision and going through walls?
2. A way to "get" any damage and spells colliding with the mount and transfer them to the player?
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm

Post » Sat Feb 19, 2011 2:58 am

Since starting up the mod I'm currently working on, I've not been able to select anything. Or rather, I can select if I drag over and multi-select, but can't do anything. But can right click just well.
User avatar
Tha King o Geekz
 
Posts: 3556
Joined: Mon May 07, 2007 9:14 pm

Post » Sat Feb 19, 2011 8:11 am

Making my first edits - wanting to add some more weapon racks into Castle Wolfspike. I emptied out one of the rooms (except for some weapon racks already there.) I copy and paste the existing racks, move them into place and save.

But... in game... only the original racks will allow items "in" them. The racks I placed act like solid rectangles in their collision.

Just learning my way around the CS... brand new. Any help would be appreciated.
User avatar
Kat Stewart
 
Posts: 3355
Joined: Sun Feb 04, 2007 12:30 am

Post » Fri Feb 18, 2011 7:16 pm

New thread: http://www.gamesas.com/index.php?/topic/1162799-quick-questions-quick-answers-the-28th/
User avatar
Jake Easom
 
Posts: 3424
Joined: Sun Jul 29, 2007 4:33 am

Previous

Return to IV - Oblivion