Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Wood cutting.


Zerengil
 Share

Recommended Posts

So, I'm trying to get a script for wood cutting up and running, and I've got most of it done the only ,missing part is the beginning.

I want the script to run on weapon swing, but there is no such thing on the CSWiki.

If I could get help on this it would be great, as this is practically needed for my survival mod.

Link to comment
Share on other sites

@Hanaisse - I haven't made a custom animation for cutting wood, I'm thinking of using the normal "hack 'n' slash" from Vanilla.

@Critterman - I'll try this and see how it works.

@Echonite - I'm making the script for the axe that are used.

Thanks for the quick answers.

Link to comment
Share on other sites

this is the lines that will detect a weapon swing, then get the ref the player is looking at:

if (player.IsAttacking == 1 && player.getequipped == YourWeaponRef)

	set tempref to getcrosshairref

Im just working on the bit of script to check if the ref is a a tree....not as easy as it sounds.

Link to comment
Share on other sites

Tested and works fine for me. Will run whenever you use your weapon at a tree.

ref tempref

string_var FormIDString

short flip

float timer


begin gamemode

if (player.IsAttacking == 1 && player.getequipped [WeaponID] == 1 && flip == 0)

	set flip to 1

	set timer to 0.75

	set tempref to getcrosshairref

	set tempref to tempref.GetBaseObject

	let FormIDString := GetModelPath tempref

	if (sv_Find "Tree" FormIDString == 1)

		messageBox $FormIDString ;;Displays Tree model path for testing

		[Do Stuff]

	endif

elseif (flip == 1)

	if (player.IsAttacking == 0)

		set flip to 0

	elseif (timer > 0)

		set timer to timer - Getsecondspassed

	elseif (timer <= 0)

		set flip to 0

	endif

endif

end

tell me if it works, if not Ill begin testing it.

Link to comment
Share on other sites

Now, I've got a new problem. I need to swap a clutter/any object to a static object.

Any command for that?

I've searched this page: http://cs.elderscrol...st_of_Functions but have found nothing.

Im not sure what you mean by this ?

It's also the sad problem that I can't get this to work with rocks, by just changing tree to rock.

okay, if you want that to work with rocks, use this for the string search:

	if (sv_Find "Rocks" FormIDString == 0)

The reason just changing it to Rock didnt works is that I was lokking for tree in this position: xTreexxxx whereas with rocks you have to look for Rocks in this position: Rocksxxxxxx

This search will accept any object whose mesh is inside the Rocks folder as a rock. If you want to narrow it down more then you can make it only accept it from certain folders within Rocks...eg all rocks inside Meshes\Rocks\jeralmountains

Link to comment
Share on other sites

The idea I had for placing the camp fire was that I make an item wich uses a campfire without fire, then when dropped and light it with a spell/kindling stones.

But I need to know how to swap the unlit havoked campfire into a static object campfire.

Link to comment
Share on other sites

The best way I can see of doing this is to have an item, which the mesh has everything included (fire, logs etc) and you can turn it on/off with animations in the mesh. When you drop this item, you use a script to place it at the feet of the player, then using your fire starter on it, an animation makes the fire appear.

However that way is kinda complex, someone else might have a better idea.

Link to comment
Share on other sites

You can PlaceAtMe the static campfire stuff on the misc object. But that route would lead to game save bloat.

Your best bet would be to move an existing campire to the misc objects location and disable the misc object. Then when the fire is put out, you disable the static campfire and enable the misc object so it can be picked up.

Link to comment
Share on other sites

You can PlaceAtMe the static campfire stuff on the misc object. But that route would lead to game save bloat.

Your best bet would be to move an existing campire to the misc objects location and disable the misc object. Then when the fire is put out, you disable the static campfire and enable the misc object so it can be picked up.

Arent you restricted to 1 fire at a time then?

Also using that method, cant the misc item be the static? so then when you drop it, you can script it to go straight to the players feet, then use moveto to place a fire on it, that way the fire is the only part that needs to be moved around.

Link to comment
Share on other sites

Yes, you would have to make one set of fire for each misc object. But how many campfire objects do you need?

If the Misc Object is kicked, then the campfire would not be where the flame is. That is why I suggested what I did.

I am sure there are other ways to do it.

Link to comment
Share on other sites

  • 4 weeks later...

Sorry that I haven't answered but I've been busy preparing for school.

I only need one camp fire, but it wouldn't hurt to be able to have more.

The placement method I thought of was that I have an object wich looks like an unlit campfire, wich when activated turns into a static item and a flame, where the base of the fire have the same rotations and coordinats as the object but the fire only the coordinates, to make the fire point straight up at all times.

I have seen mods wich do almost this but with a single object.

I'm open for other and (hopefully) simpler suggestions to do this but I need some hints with the script/s as what you said up here didn't make much sense. I prefer not to get ready made, working scripts as I won't learn anything then.

Link to comment
Share on other sites

So if I understand that page correctly I'd also have to make a fire in the SI world space somewhere?

Mage said he'd do the animation for his option, but I'll get to work on a script for this as well and see wich one works best.

Edited by Zerengil
Link to comment
Share on other sites

I will send the mesh over via PM. Do you want ot be included Will?

but here is the script i used on it as a misc item:


scn aaaCampfireScript


short state ;Off = 0, On = 1

short toggle

float xp


begin OnReset

	reset3dState

	playgroup backward 0

end


begin OnLoad

	playgroup backward 0

end


begin OnActivate

	if state == 0 ;Off - Turn On

		if (player.issneaking == 0)

			playgroup Forward 0

			set state to 1

		else

			activate player

		endif

	else ;On - Turn Off

		playgroup Backward 0

		set state to 0

	endif

end


Begin gamemode player

	if toggle == 2

		enable

		set toggle to 0

	endif


	if getcontainer == 0 && toggle == 1

		set toggle to 2

		disable

		moveto player 0 0 3

		set xp to getPos x

		setPos x xp

		playgroup backward 0

	endif


	if getcontainer != 0 && toggle == 0

		set toggle to 1

	endif

end

The OnReset and Onload blocks are just there t oreset the object when the player reloads it. Just to aviod any bugs it will always turn the fire off again. For the activate it has a toggle forr the fire on and off, but if the fire is off and the player is sneaking they will instead pick up the item. Lastly is the gamemode block, this checks to see if the campfire has been dropped, it then moves it to the player's feet using the technique from the moveto page + a frame skip to make the collision refresh before enabling the fire again.

If you ahve any questions on how it works, please post back. It should have no problems going between SI and Tamriel.

Link to comment
Share on other sites

Hmm, this just entered my mind, can I add a script that checks if the player have enough wood and removes that number? If so, I should add it in the activate block right?

Somewhere in here:

        else ;On - Turn Off

                playgroup Backward 0

                set state to 0

        endif

Edited by Zerengil
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...