Problem with activators, OnLoad blocks and PlayGroup

Post » Fri May 27, 2011 8:32 pm

I'm currently trying some things with the plants in game, like Xander root. More specificly their activators. All the plants have a script attached to them like the following:

scn XanderRootScriptint Statebegin onActivate	if State == 0 && GetActionRef == player		player.additem XanderRoot 1		set State to 1		playGroup Backward 1		setdestroyed 1	endifendbegin onLoad	if State == 0		playGroup Forward 1	elseif State == 1		playGroup Backward 1			endifendbegin onReset	if State == 1		playgroup Forward 1		set State to 0		setdestroyed 0	endifend


Now to the problem. I have created a new script for them that i attached to the activators, replacing the above code entirely. Now, everything works fine untill a certain condition is met.

If i picked a plant somewhere, went on with my game, then activate my mod (replacing the script) and then came to the plant again that i had already picked, it's PlayGroup animation is reversed. I see a "picked" plant, yet i can pick it and it gets "un-picked". Ofcourse this aint right.

As far as i know the problem has to do with the fact that i replaced the script and the "state" variable. In that they get mixed up. If i pick a plant in the vanilla game the state gets set to 1 and the plant plays the forward animation. But since i use my mod the state variable is now 0, yet it still plays the forward animation. hence it being reversed. At least, that's what i think is going on.

The problem is that i have no idea how to solve it, i tried many things, but nothing seems to work.

Can anyone tell me how i can "reset" the plant status when my mod is loaded, in that it's a normal "pickable" plant.
User avatar
Alexandra Louise Taylor
 
Posts: 3449
Joined: Mon Aug 07, 2006 1:48 pm

Post » Sat May 28, 2011 4:58 am

Have you tried using http://geck.gamesas.com/index.php/Reset3DState?

Cipscis
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm

Post » Sat May 28, 2011 7:06 am

I didn't try that, though i tried to use it now. But it does not seem to have any effect.

Maybe it's my understanding of the blocks thats the problem.

I'm trying to reset it in the OnLoad block.
User avatar
Je suis
 
Posts: 3350
Joined: Sat Mar 17, 2007 7:44 pm


Return to Fallout: New Vegas