copy logic to selected state

Copy means entirely new.

OK, I think I know why it was giving an error. I wasn’t changing the active state number and trying to copy to another state. I tried Monsters again and it is somewhat of a nightmare. It only seem to work going from state 1 to state 2 ,but if your on state 2 and want to copy to state 3. State 3 becomes a tangled mess with the linking.

With those four words I think it’s back to the drawing board. What I got working now is just linking to new controllers on different states. I think what your wanting is new controllers, sensors, and actuators that is on a certain state. That’s actually what I was trying to do in first code I posted.

Just to let you know. My code is a modification of your code ;).

They are new controllers,sensors and actuators but they have to be copies.

You can finish it after thaksgiving if you like.

Lostscience, I modified the save logic addon and I think it will do what your wanting. It’s not really a “copy and paste”, cause you have to save it. When I get more time I’m gonna see if I can get rid of having to save it and make it more in blender itself. I did solve one of my other issues by messing around with it. It pretty much works like the other addon. There is a spot to define which logic bricks get saved/copied. So if your “copying” state 2, you need to add a unique symbol on all that’s on state 2. The other addon saved all of them. You can decide the state that they will be added to before you add it and also assign the logic brick names a new number each time, so the new ones will be linked.

Here’s addon copy_logic_state3.zip (11.1 KB)

.


I am going to test your addon now.

It needs to be intiutive i think.Like copy logic bricks to the state you selected on the last npc selected with shift
plus left click.You can do this when you get it more into blender itself.

Try this Lostscience logic_to_states.zip (6.42 KB) This is the best I got. Maybe somebody else can come up with something better. I tried messing around with the selected states, to much crashing,LOL. Not sure if that’s even possible, since I don’t think states act like objects where you can have a selected plus a active. It will make duplicate sensors and actuators if they are connected to more than one controller. Try different setups and you can see how it acts depending on how they are linked.

Here is the error i get.Do install the addon as a zip file?

Read new prefs: C:\Users\barbara\AppData\Roaming\Blender Foundation\Blender\2.78\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.78\python


addon_utils.disable: logic_state_to_state not disabled.
Modules Installed from 'C:\\Users\\barbara\\Downloads\\logic_state_to_state.zip' into 'C:\\Users\\barbara\\AppData\\Roaming\\Blender Foundation\\Blender\\2.78\\scripts\\addons' (logic_state_to_state)
<!> event has invalid window
<!> event has invalid window

Unzip and place in addons. Making a zip file was the only way I could get it uploaded. I see your using using 2.78. I haven’t upgraded so can’t confirm if it works on 2.78.

If the other files worked, don’t know why this one wouldn’t.

I put it in user contributed addons and then addons and it does not work.I cannot enable it.

Did the one the other day work?

See if you can copy the text in the text editor and see what happens.

It did work.Nothing happens when i do that.

Replaced file on post #30, try it now. I tried to install 2.78 on my current computer ,but it can’t handle it .I’ll have to get on my other one and see why it won’t install if it still doesn’t.

I tried many things but it does not work.


Read new prefs: C:\Users\barbara\AppData\Roaming\Blender Foundation\Blender\2.78\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.78\python


Modules Installed from 'C:\\Users\\barbara\\Desktop\\logic_state_to_state.py' into 'C:\\Users\\barbara\\AppData\\Roaming\\Blender Foundation\\Blender\\2.78\\scripts\\addons' ()
<!> event has invalid window

It don’t look like you tried the updated file. The new one is named “logic_to_states.py”. The error you posted is showing “logic_state_to_state.py”. I’ll Upload 2.78 on my other computer later this week and see what’s up.

I tried it now and it still does not work.

thank you very much, this has helped