Jump to content

Recommended Posts

Posted

Ah yes, forgot that it was float.

 

Regarding a "move the object around" script, there is one at the Geck/CS's tutorial pages at Bethesda, but can't find it now cos the search functions has gone wonky.

 

It requires you to have script extender cos ur going to be hitting a button when releasing it.

  • Replies 49
  • Created
  • Last Reply

Top Posters In This Topic

Posted

You should add MarkForDelete AFTER Disable in order to completely delete the reference.

 

scn 0MCWoodHarvestScript

Begin OnHitWith 0WeapAxeIron

Player.AddItem mcblockwood 1
Disable
MarkForDelete

End

Posted (edited)

I created this script that should make the player have to hit the block 3 times (iHealth) within 2 seconds of each hit. If it goes past 2 seconds, it will reset.

I don't have FO3 installed on this computer so I can't test it myself, but you can try if you want.

 

scn 0MCWoodHarvestScript

int iHealth
int iDoOnce
int iStage

float fTimer

Begin OnHitWith 0WeapAxeIron

if ( iHealth == 0 )
	Player.AddItem mcblockwood 1
	Disable
	MarkForDelete
else
	Set fTimer to 2
	Set iStage to 1
	Set iHealth to iHealth - 1
endif

End

Begin GameMode

if ( iDoOnce == 0 )
	Set iHealth to 3
	Set iDoOnce to 1
endif

if ( fTimer > 0 )
	Set fTimer to fTimer - GetSecondsPassed
elseif ( iStage == 1 )
	Set iStage to 0
	Set fTimer to 0	
endif

End

Edited by Alexx378
Posted

Thanks for all your help Rausheim!

Really means a lot :)

The script works perfectly!

The only problems I had was that it's X and Y co ordinates were always lob sided but I countered that by adding them to the float too.

Now the way the block is placed depends on where the player view is aimed at. Looking directly ahead will place the block PERFECTLY (at least very very close)

Another problem I have it... I kinda get stuck in the block :P But jumping managed to get me out of it.

Is there a way I could activate "tcl" for one second upon dropping? Just so I can get free?

 

@Alexx378

Thanks for the heads up about MarkForDelete, I included that into the script and it works fine :)

 

That script you made for multiple hits was very generous of you! I can't believe the amount of help you and Rausheim are giving me.

You guys are the best!

 

I'll try adding it in now and tell you the results when I get them :)

Again thanks!

Posted

Okay so I tested that script ingame.

 

The script just before you edited this one worked great.

It took 3 hits to destroy the block

But the timer didn't seem to reset at any time.

If I hit one block and left it for about a minute then hit it 2 more times it was destroyed, instead of it taking 3 hits.

 

The script currently works great took.

It takes 4 hits to destroy the block

But like the previous script the timer doesn't reset.

 

 

But in all honesty it's no biggy.

The fact it takes 3 hits to destroy a block has already made me speechless!

 

But yeah thanks to you the blocks disappear properly and now take a few hits to destroy

and thanks to Rausheim the blocks can now be placed back into the world!

Here's an image of that

 

  Reveal hidden contents

 

Posted (edited)

Hmm... I never been good with timers. I will see what I can do when I get access to FO3 again. :) But it may be a while.

 

If you change "if ( iHealth == 0 )" --> "if ( iHealth == 1 )" it will take 3 hits again.

Edited by Alexx378
Posted

I really appreciate what you've done already.

I'm in no rush to get Falloutcraft complete anyway, everytime I rush things I tend to make mistakes.

But any help you or anyone else can provide is always welcome, for this I will definitely be including you both into the credits section when I've released this version.

 

Yeah I noticed the differences, I think I'll stick with 4 for now.

I'll decide later which I want :)

 

Again, thanks a lot.

 

Just need to figure out how to get out of the block I place without the need to jump :)

Posted (edited)
  On 7/2/2011 at 6:25 PM, Alexx378 said:
if ( iDoOnce == 0 )
Set iHealth to 3
Set iDoOnce to 1
endif

Why have you got a if(iDoOnce) running every frame when you could've easily had the health count up from 0->3 instead?

E: It's not even an optimal if, that'd be if(iDoOnce), else.

Edited by TheTalkieToaster
Posted
  On 7/2/2011 at 9:21 PM, TheTalkieToaster said:
  On 7/2/2011 at 6:25 PM, Alexx378 said:
if ( iDoOnce == 0 )
Set iHealth to 3
Set iDoOnce to 1
endif

Why have you got a if(iDoOnce) running every frame when you could've easily had the health count up from 0->3 instead?

E: It's not even an optimal if, that'd be if(iDoOnce), else.

 

Hmm so what would you suggest I change in the script then?

I'm open to any and all opinions and suggestions.

Even optimisations :)

 

Also

I'd just like to point out I have over 2050 blocks with that script attached in a cell with absolutely no issues or any change to my framerate :)

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...