[REQ/WIP] ModFood: Snippets & Tips

Post » Wed Dec 07, 2011 4:28 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
Dezzeh
 
Posts: 3414
Joined: Sat Jun 16, 2007 2:49 am

Post » Wed Dec 07, 2011 11:48 am

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
i grind hard
 
Posts: 3463
Joined: Sat Aug 18, 2007 2:58 am

Post » Wed Dec 07, 2011 6:12 am

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

EDIT: NVM, found it. Dizzy from all the threads... :wacko:
User avatar
emma sweeney
 
Posts: 3396
Joined: Fri Sep 22, 2006 7:02 pm

Post » Wed Dec 07, 2011 7:27 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
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Wed Dec 07, 2011 5:50 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
leni
 
Posts: 3461
Joined: Tue Jul 17, 2007 3:58 pm

Post » Wed Dec 07, 2011 2:16 pm

Cool, I just do whatever the teacher tells me to :P but needless to say, I'm learning all the time eh?
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Wed Dec 07, 2011 6:26 pm

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
Dewayne Quattlebaum
 
Posts: 3529
Joined: Thu Aug 30, 2007 12:29 pm

Post » Wed Dec 07, 2011 11:08 am

This is definitely going into the tutorial section ^_^. Very cool Felic.
User avatar
kitten maciver
 
Posts: 3472
Joined: Fri Jun 30, 2006 2:36 pm

Post » Wed Dec 07, 2011 3:09 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
Rusty Billiot
 
Posts: 3431
Joined: Sat Sep 22, 2007 10:22 pm

Post » Wed Dec 07, 2011 8:28 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
Roanne Bardsley
 
Posts: 3414
Joined: Wed Nov 08, 2006 9:57 am

Post » Wed Dec 07, 2011 7:58 pm

It's the previous tutorial, see just above.
User avatar
Kortniie Dumont
 
Posts: 3428
Joined: Wed Jan 10, 2007 7:50 pm

Post » Wed Dec 07, 2011 4:42 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
Kat Ives
 
Posts: 3408
Joined: Tue Aug 28, 2007 2:11 pm

Post » Wed Dec 07, 2011 4:20 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
A Boy called Marilyn
 
Posts: 3391
Joined: Sat May 26, 2007 7:17 am

Post » Wed Dec 07, 2011 6:19 pm

Hmm, I might have a look at them...
User avatar
Isabella X
 
Posts: 3373
Joined: Sat Dec 02, 2006 3:44 am

Post » Wed Dec 07, 2011 2:06 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
Rob
 
Posts: 3448
Joined: Fri Jul 13, 2007 12:26 am

Post » Wed Dec 07, 2011 12:17 pm

Right, thanks for the heads up, I'll fix that.
User avatar
sarah
 
Posts: 3430
Joined: Wed Jul 05, 2006 1:53 pm

Post » Wed Dec 07, 2011 9:16 am

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
Alexis Estrada
 
Posts: 3507
Joined: Tue Aug 29, 2006 6:22 pm

Post » Wed Dec 07, 2011 10:44 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
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

Post » Wed Dec 07, 2011 8:10 am

Thanks WillieSea. Added it to the index. :)
User avatar
Kim Kay
 
Posts: 3427
Joined: Fri Oct 13, 2006 10:45 am

Post » Wed Dec 07, 2011 1:48 pm

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
Ella Loapaga
 
Posts: 3376
Joined: Fri Mar 09, 2007 2:45 pm

Post » Wed Dec 07, 2011 4:25 am

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
ruCkii
 
Posts: 3360
Joined: Mon Mar 26, 2007 9:08 pm

Post » Wed Dec 07, 2011 4:18 am

Keep them coming, great work so far! :goodjob:
User avatar
Daniel Holgate
 
Posts: 3538
Joined: Tue May 29, 2007 1:02 am

Post » Wed Dec 07, 2011 3:10 pm

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
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Wed Dec 07, 2011 4:48 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
Rachyroo
 
Posts: 3415
Joined: Tue Jun 20, 2006 11:23 pm

Post » Wed Dec 07, 2011 5:05 pm

.
User avatar
Your Mum
 
Posts: 3434
Joined: Sun Jun 25, 2006 6:23 pm

PreviousNext

Return to IV - Oblivion