[REQ/WIP] ModFood: Snippets & Tips

Post » Sat Feb 19, 2011 8:44 am

Went on a very awkward vacation, don't ask why we did it in Febuary cuz I don't know, but I'm back now :)

B.T.W, why do you change your sig like, every other week logam.


I do it for a bit of change i guess :P

Same with my avatar... :rofl:

Felic, i added your thread to Modders Resource. :)
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Post » Fri Feb 18, 2011 10:24 pm

I'm busy collating all there is in the wiki and the forums into a word document at the moment, at present time it's almost all links to either the wiki, this forum, or one other site i managed to find during a web trawl.

BTW, I can't seem to tell if this Word Document is Macro'd or not, so I'll save it once as a word document, and once as an Open Office Document. DL either, and if you wish to email me, I'll open up my gmail addy on request (I'm weary of spammers...)
User avatar
Shianne Donato
 
Posts: 3422
Joined: Sat Aug 11, 2007 5:55 am

Post » Sat Feb 19, 2011 2:21 am

Please use PDF, I'll convert for you...

EDIT: NVM, found it. Dizzy from all the threads... :wacko:
User avatar
Chelsea Head
 
Posts: 3433
Joined: Thu Mar 08, 2007 6:38 am

Post » Sat Feb 19, 2011 7:34 am

Please use PDF, I'll convert for you...


It turns out that Open Office will do it gladly :) It's the second last one down. Also, if you *do* have word (or open Office) and you want to contribute, simply edit away :D

Making the thing you want as a title a heading 1 will have the biggest title in the Table of contents.
A Heading 2 will be the Second Biggest
And a heading 3 will be a side title.

Imagine a large book with many mini-stories in it. The mini-story is the Story, Heading 2 the Chapter and heading 3 the.... page?

All similarity is lost, will take some headache tablets now :P
User avatar
Sabrina Schwarz
 
Posts: 3538
Joined: Fri Jul 14, 2006 10:02 am

Post » Sat Feb 19, 2011 9:23 am

No worries, I got years of experience as a temp and web developer, so can create stylesheets in word in my sleep, I just hate it.
User avatar
Inol Wakhid
 
Posts: 3403
Joined: Wed Jun 27, 2007 5:47 am

Post » Sat Feb 19, 2011 11:25 am

Cool, I just do whatever the teacher tells me to :P but needless to say, I'm learning all the time eh?
User avatar
Gavin boyce
 
Posts: 3436
Joined: Sat Jul 28, 2007 11:19 pm

Post » Sat Feb 19, 2011 8:59 am

Objective: Making a realistic creature statue when you don't know 3D modeling

NOTE: I edited this as I found it doesn't really work with NPCs, just creatures.

Thanks to Reznod for a lot of ideas and solutions!

Wanna make a custom statue, or stuffed actor :lol:, for your ?ber house mod? Cool, but before we get started, there's one drawback with this method: the animation plays when the player enters the cell, so you have to place the statue out of the PoV the player has when they enter the cell. Around a corner, in an alcove, or something along those lines.

OK, there are several steps to be taken here. First, pick your creature and dupe it. Check No Low Level Processing, remove any packages from the AI, remove Factions and any unnecessary Inventory and Spells. Then pick your spot, maybe add a pedestal of some sort, and position your statue.

Now let's build the scripts. One thing we need to take care of is disabling the Detect Life visuals on the statue. This is done via an Ability with Script Effect. So first create a new script, and select Magic Effect in the drop down menu at the top. Then enter this code and save.

Scn aaaStatueDDLVBegin ScriptEffectUpdate	StopMagicShaderVisuals LifeDetectedEnd


Now create a new spell with ID aaaStatueAb and Type Ability (name it what you want). Check the options Disallow Spell Absorb/Reflect, Script Effect Always Applies, and Immune to Silence just to be safe. Now right-click in the Effects and choose Script Effect. Select the Script we just created and uncheck Effect is Hostile (you can also give it a name if you want). Add this spell to your statue's spell list.

OK, now the script that plays an animation group and freezes the creature in place. You'll need to pick an animation group. There's a complete list http://cs.elderscrolls.com/constwiki/index.php/AnimGroups (note most creatures don't have all of these: you can see the groups available for the actor you're using in their Animation tab). You're also going to have to experiment a little to get the exact pose you want by changing the timer check value. In this script, you will also have to change the 0 values for the setPos x,y,z,angle lines to the position you chose for your actor (double-click on the actor in the Render Window to get these values; it's best to round them). So create a new script (using default Object type), and paste in this code (you can remove the comments), then change the values as mentioned just above:

Scn aaaNoMoveScriptFloat TimerShort doOnceBegin onLoad; resets timer for current cell load	set Timer to 0; resets var for current cell load, so setRestrained/setGhost aren't called every frame	set doOnce to 0; need to input values for these or else actor will spawn in between path grid nodes	setPos x 0	setPos y 0	setPos z 0	setAngle z 0; turn on for weapon drawn anim; use 0 for no weapon drawn	SetAlert 1; pick group from list provided	PlayGroup AttackForwardPower, 1EndBegin GameMode; change value for desired pose	if ( Timer < 0.5 ); this increments timer var to be able to stop anim		set Timer to ( Timer + GetSecondsPassed )	else; these only need to be set once when player enters cell		if doOnce == 0			set doOnce to 1; Unconscious actors do not "think" at all; this is not absolutely necessary, but can't hurt			setUnconscious 1; Restrained actors will not move from their current position, but will continue to "think" (pick packages, run detection so they could yell alarms) & go into dialogue			setRestrained 1; no combat, not harmed by hits/spells, will talk, cannot be pickpocketed			setGhost 1		endif; causes the current animation to not be played for this frame	skipAnim	endifEnd


Now attach this script to your statue by opening the actor window and selecting the script from the drop down menu. Go in the game and check the result, and adjust the Anim Group and Timer stop value to get the pose you want.

Fini!
User avatar
emma sweeney
 
Posts: 3396
Joined: Fri Sep 22, 2006 7:02 pm

Post » Sat Feb 19, 2011 5:45 am

This is definitely going into the tutorial section ^_^. Very cool Felic.
User avatar
Donatus Uwasomba
 
Posts: 3361
Joined: Sun May 27, 2007 7:22 pm

Post » Fri Feb 18, 2011 9:00 pm

Objective: Locking items in place

Do you want to place a weapon or shield on the wall and it keeps falling down in game when you get near it? Or do your books fly out of whack coz you placed them like they should look on a shelf but the Havok engine doesn't account for that? Try attaching this script to a dupe of the object (you don't want to lock all the same objects in the game; also does not work on actors, see the tutorial on making a statue in this thread for that).

Scn aaaNoMoveScriptFloat MyXFloat MyYFloat MyZFloat MyAxFloat MyAyFloat MyAzBegin onLoad	Set MyX to GetPos X	Set MyY to GetPos Y	Set MyZ to GetPos Z	Set MyAx to GetAngle X	Set MyAy to GetAngle Y	Set MyAz to GetAngle Z	setPos x MyX	setPos y MyY	setPos z MyZ	setAngle x MyAx	setAngle y MyAy	setAngle z MyAzEnd

User avatar
Juan Suarez
 
Posts: 3395
Joined: Sun Nov 25, 2007 4:09 am

Post » Sat Feb 19, 2011 3:04 am

Neat trick. Now I ask, is there a way to do the same to npc's? Like a ragdoll poser or something? That'll be a fun thing to add.
User avatar
Breanna Van Dijk
 
Posts: 3384
Joined: Mon Mar 12, 2007 2:18 pm

Post » Sat Feb 19, 2011 2:36 am

It's the previous tutorial, see just above.
User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Fri Feb 18, 2011 11:14 pm

No, when I mean pose them, I mean "grab their leg and freeze it" Then move their arm and freeze it. What I want is to make them statues in-game. If possible, they should be unlockable. Basically the it's going to be a Gmod posergun.
User avatar
Alexandra Ryan
 
Posts: 3438
Joined: Mon Jul 31, 2006 9:01 am

Post » Sat Feb 19, 2011 4:56 am

Ah, I see now. Don't think that's possible, since the skeleton is a single mesh. Actors in Charge and Rez's Mannequins both use animation files (.kf) to pose actors.
User avatar
His Bella
 
Posts: 3428
Joined: Wed Apr 25, 2007 5:57 am

Post » Sat Feb 19, 2011 6:43 am

Hmm, I might have a look at them...
User avatar
asako
 
Posts: 3296
Joined: Wed Oct 04, 2006 7:16 am

Post » Fri Feb 18, 2011 11:51 pm

Objective: Mark & Recall Teleportation Spells

Make two spells that allow you to mark a spot that you can return to via the recall spell from anywhere in the game.

Thanks to weasel93 for the script.

Place a teleport marker somewher in Tamriel and give it a Reference ID (let's use "aaaMarkRecallTeleport").
Create a "Mark" spell and attatch this script via Script Effect (and give it a cool visual effect):

Scn aaaMarkSpellScriptBegin ScriptEffectStart	PlaceAtMe aaaMarkRecallTeleport 1, 0, 0	MessageBox "You have marked this location."End


Then make a "Recall" spell and attatch this script to it:

Scn aaaRecallSpellScriptBegin ScriptEffectStart	Player.MoveToMarker aaaMarkRecallTeleportEnd


Fini!


Can you use PlaceAtMe with references? I always thought it would have to be an Object ID, not a unique reference. It's probably safer to use a MoveTo command:
Begin ScriptEffectStart	aaaMarkRecallTeleport.MoveTo player	MessageBox "You have marked this location"End

User avatar
no_excuse
 
Posts: 3380
Joined: Sun Jul 16, 2006 3:56 am

Post » Sat Feb 19, 2011 4:41 am

Right, thanks for the heads up, I'll fix that.
User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm

Post » Fri Feb 18, 2011 11:51 pm

QUOTE(Felic @ Feb 26 2007, 05:18 PM)

Hey Logam, I'll bump yours if you bump mine!


Official Requested Bump :P

Good Thread Felic, Keep up the great work! ^__^
User avatar
Michael Korkia
 
Posts: 3498
Joined: Mon Jul 23, 2007 7:58 pm

Post » Sat Feb 19, 2011 5:40 am

Objective: Wearing an Amulet that makes Wildlife (or anything) Passive towards you

=============================================================
Works great to make certain animals not attack you when worn.
=============================================================

1. Create 'Spell' called 'HeroPeaceAbility' that is an ability. Give it effects if you like.
-Example: Resist disease @ 100%

2. Create a 'Faction' called 'HeroPredators'.
- Give it a name, 'Peaceful Wildlife'.
- In the 'Interfaction Relations' box, add the 'HeroPredators' and make the Disposition Modifier '100'.

3. Add the new faction 'HeroPredators' to all the creatures you want to be passive when the amulet is worn.

4. Create a new Script:
scn HeroAmuletPeaceScriptbegin OnEquip player	Player.SetFactionRank HeroPredators 0	Player.AddSpell HeroPeaceAbilityendbegin OnUnequip player	Player.SetFactionRank HeroPredators -1	Player.RemoveSpell HeroPeaceAbilityend


5. Create a new amulet Items+Clothing+Amulets.
- Give it an ID, Name, add the script 'HeroAmuletPeaceScript', value, and make sure it is checked playable.

6. Drop the amulet into the gameworld where you want to pick it up.
User avatar
Elizabeth Davis
 
Posts: 3406
Joined: Sat Aug 18, 2007 10:30 am

Post » Sat Feb 19, 2011 12:46 am

Thanks WillieSea. Added it to the index. :)
User avatar
Yvonne
 
Posts: 3577
Joined: Sat Sep 23, 2006 3:05 am

Post » Sat Feb 19, 2011 5:28 am

Right, so I've written my own Mark/Recall spells using the information here. Took me a while to figure out how to make the doors, and make them invisible, and make them non-usable except for the spells, but I did it. Maybe there's a magical "place teleport reference here" button, but I couldn't find it. :(

Now I just need to figure out how to disable changes to the weather when I recall (and re-enable them afterwards, I think). ><

After that I'm gonna write myself a bound arrows spell too. I'd been thinking along those lines recently and then I saw someone else's thread about it. :) Thanks for the great info here guys!
User avatar
Stephanie Kemp
 
Posts: 3329
Joined: Sun Jun 25, 2006 12:39 am

Post » Fri Feb 18, 2011 10:25 pm

OBJECTIVE: Setting Outside weather to be the same on the Inside cell
When using "Behave like Exterior" on your inside cell.

====================================
Tamriel Weather Types
====================================
CamoranWeather 000370CE
Clear 00038EEE
Cloudy 00038EFE
DefaultWeather 0000015E
Fog 00038EEF
Overcast 00038EEC
Rain 00038EF2
Snow 00038EED
Thunderstorm 00038EF1

OblivionStormTamriel - 000836D5
OblivionStormTamrielMQ16 0006BC8B

===================================================

1. Create a global variable called 'HeroWeatherType'.

2. OUTSIDE: This script goes on an activator close to the door that leads inside:

Scn HeroArenaSetScriptBegin GameMode	if ( HeroWeatherType == 0 )		if ( getdistance player < 400 )			set HeroWeatherType to 1			if ( GetIsCurrentWeather "Clear" )				set HeroWeatherType to 1			endif			if ( GetIsCurrentWeather "Cloudy" )				set HeroWeatherType to 2			endif			if ( GetIsCurrentWeather "DefaultWeather" )				set HeroWeatherType to 3			endif			if ( GetIsCurrentWeather "Fog" )				set HeroWeatherType to 4			endif			if ( GetIsCurrentWeather "Overcast" )				set HeroWeatherType to 5			endif			if ( GetIsCurrentWeather "Rain" )				set HeroWeatherType to 6			endif			if ( GetIsCurrentWeather "Snow" )				set HeroWeatherType to 7			endif			if ( GetIsCurrentWeather "Thunderstorm" )				set HeroWeatherType to 8			endif		endif	endifEnd


===================================================

2. INSIDE: This script goes on an activator close to the door that leads back outside.

Scn HeroArenaLoadScriptBegin GameModeif ( HeroWeatherType > 0 )	if ( getdistance player < 400 )		if ( HeroWeatherType == 1 )			ForceWeather "Clear"			Set HeroWeatherType to 0		elseif ( HeroWeatherType == 2 )			ForceWeather "Cloudy"			Set HeroWeatherType to 0		elseif ( HeroWeatherType == 3 )			ForceWeather "DefaultWeather"			Set HeroWeatherType to 0		elseif ( HeroWeatherType == 4 )			ForceWeather "Fog"			Set HeroWeatherType to 0		elseif ( HeroWeatherType == 5 )			ForceWeather "Overcast"			Set HeroWeatherType to 0		elseif ( HeroWeatherType == 6 )			ForceWeather "Rain"			Set HeroWeatherType to 0		elseif ( HeroWeatherType == 7 )			ForceWeather "Snow"			Set HeroWeatherType to 0		elseif ( HeroWeatherType == 8 )			ForceWeather "Thunderstorm"			Set HeroWeatherType to 0		elseif ( HeroWeatherType > 8 )			ForceWeather "Clear"			Set HeroWeatherType to 0		endif	endifendifend


===================================================

3. OUTSIDE: This script goes on an activator a bit further from the door that leads inside: This will reset the HeroWeatherType so it will correctly report to script #1 the true weather.

The player MUST pass close by this activator on entry and exit to the doorway to the interior cell. I put it under the ground on the path to the doorway. NOTE: Dont place it too close to the activator #1.

Scn HeroArenaResetScriptBegin GameMode	if ( HeroWeatherType > 0 )		if ( getdistance player < 200 )			set HeroWeatherType to 0		endif	endifend

User avatar
Chantel Hopkin
 
Posts: 3533
Joined: Sun Dec 03, 2006 9:41 am

Post » Fri Feb 18, 2011 11:55 pm

Keep them coming, great work so far! :goodjob:
User avatar
Donatus Uwasomba
 
Posts: 3361
Joined: Sun May 27, 2007 7:22 pm

Post » Sat Feb 19, 2011 5:19 am

OBJECTIVE: Close and lock opened door.

With this script, you can set the door to automatically close AND lock.
After the player unlocks a door, a 10 second timer starts counting. The door is then closed, and after 2 seconds, it is re-locked. Can be used like a trap.

scriptname TELElockScriptfloat timershort doWhatBegin GameMode	if ( getlocked )	else		if timer > 0			set timer to timer - getsecondspassed		else			if doWhat == 2				lock 100				set doWhat to 0				return			elseif doWhat == 1				set timer to timer + 2				setopenstate 0				set doWhat to 2				return			elseif doWhat == 0				set timer to timer + 10				set doWhat to 1				return			endif		endif	endifEnd


I have more, but I can't add another one until somebody else posts. Otherwise, it just adds the new post to the bottom of this post...
User avatar
matt oneil
 
Posts: 3383
Joined: Tue Oct 09, 2007 12:54 am

Post » Sat Feb 19, 2011 1:33 am

Thanks again!
Actually, posting again in a new post is set on a timer I think. Not sure how long, but you should be able to add a new post after one hour at the most.
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Sat Feb 19, 2011 12:37 am

.
User avatar
A Dardzz
 
Posts: 3370
Joined: Sat Jan 27, 2007 6:26 pm

PreviousNext

Return to IV - Oblivion