Home   Help Search Login Register  

Author Topic: AddAction/RemoveAction problem  (Read 1011 times)

0 Members and 1 Guest are viewing this topic.

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
AddAction/RemoveAction problem
« on: 07 Aug 2003, 15:01:53 »
OK were to start

right as you may know I'm making a elevator addon with buildings and lift's

now i have the lift part perfectly scripted and working with new models

as you can see still work needed but i just wont the lift control working first

"MY PROBLEM"

OK at the end of each script i use to activate the lift to go to a certain level or the tower it calls a script to remove old actions and add new ones eg;

first script

script1.sqs
Code: [Select]
balhbalhbalhbalh; don't worry about this its just a demo script
F = mc squared ;; and this to
this exec "1st.sqs"

now the 1st.sqs looks like this as do the other scripts to add/remove actions
Code: [Select]
titletext["1st Floor","PLAIN DOWN"]
player removeaction _floor0
player removeaction _floor1
player removeaction _floor2
player removeaction _floor3
player removeaction _floor4
player removeaction _floor5
player removeaction _floor6
player removeaction _floor7

~1
_floor0 = player addaction ["Ground Floor","1st\grounddown.sqs"]
_floor1 = player addaction ["2nd Floor","1st\2ndFloor.sqs"]
_floor2 = player addaction ["3rd Floor","1st\3rdFloor.sqs"]
_floor3 = player addaction ["4th Floor","1st\4thFloor.sqs"]
_floor4 = player addaction ["5th Floor","1st\5thFloor.sqs"]
_floor5 = player addaction ["6th Floor","1st\6thFloor.sqs"]
_floor6 = player addaction ["7th Floor","1st\7thFloor.sqs"]
_floor7 = player addaction ["8th Floor","1st\8thFloor.sqs"]

now when i get to the floor it gives me the new commands to go to 2nd,3rd,4th,5th,6th,7th,gnd but i don't take away old commands any idea's on how to fix this???

i hope you understand

Msn ="Wizzywig [this] exec "lift_me_up_please.sqs" says:
actions in the command menu you get dont del old ones before adding news ones"
« Last Edit: 07 Aug 2003, 15:14:14 by WizzyWig »

deaddog

  • Guest
Re:AddAction/RemoveAction problem
« Reply #1 on: 07 Aug 2003, 15:31:51 »
You should make your _floor variables global.  Since you have a different script for each floor, they have no way of knowing what the value of the _floor variables are.  As it stands, all the floor variables are local and not available anywhere but the script that contains them.   :)

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:AddAction/RemoveAction problem
« Reply #2 on: 07 Aug 2003, 16:05:17 »
show me please how and remember that thay are

1. RemoveAction
2. AddAction

e.g

out with old in with new

deaddog

  • Guest
Re:AddAction/RemoveAction problem
« Reply #3 on: 07 Aug 2003, 16:24:35 »
Remove the underscore (_) from in front of the name:  _floor1 is now floor1.

This makes the variable global and all scripts have access to it.

Easy  :)  (Once you know how)

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:AddAction/RemoveAction problem
« Reply #4 on: 07 Aug 2003, 16:31:43 »
ok this still give the same problem all the action sstill remain and its not removing old actions

Code: [Select]
titletext["1st Floor","PLAIN DOWN"]
player removeaction floor0
player removeaction floor1
player removeaction floor2
player removeaction floor3
player removeaction floor4
player removeaction floor5
player removeaction floor6
player removeaction floor7

~1
floor0 = player addaction ["Ground Floor","1st\grounddown.sqs"]
floor1 = player addaction ["2nd Floor","1st\2ndFloor.sqs"]
floor2 = player addaction ["3rd Floor","1st\3rdFloor.sqs"]
floor3 = player addaction ["4th Floor","1st\4thFloor.sqs"]
floor4 = player addaction ["5th Floor","1st\5thFloor.sqs"]
floor5 = player addaction ["6th Floor","1st\6thFloor.sqs"]
floor6 = player addaction ["7th Floor","1st\7thFloor.sqs"]
floor7 = player addaction ["8th Floor","1st\8thFloor.sqs"]

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:AddAction/RemoveAction problem
« Reply #5 on: 08 Aug 2003, 17:37:16 »
some more SS


deaddog

  • Guest
Re:AddAction/RemoveAction problem
« Reply #6 on: 08 Aug 2003, 18:40:44 »
First of all, you need to remove the underscores from all of the other scripts.

Second, you forgot to add a removeaction for floor8 in commandbox\1st.sqs file.

Third, you have several addaction commands without assigning them a floor variable.

I removed the underscores and added a removeaction for floor8 and everything worked great.

 :)


I hope you get it all straightened out because that looks like it would be a cool building.  8)
« Last Edit: 08 Aug 2003, 18:41:58 by deaddog »

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:AddAction/RemoveAction problem
« Reply #7 on: 08 Aug 2003, 19:12:11 »
wow if only i got you the first time

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:AddAction/RemoveAction problem
« Reply #8 on: 08 Aug 2003, 22:07:02 »
ok thanks for all the help but im getting this only on the 4th floor all the rest are fine

titletext["4th Floor","PLAIN DOWN"]
player removeaction floor0
player removeaction floor1
player removeaction floor2
player removeaction floor3
player removeaction floor4
player removeaction floor5
player removeaction floor6
player removeaction floor7
player removeaction floor8

floor0 player addaction ["Ground Floor","\wizbuid\scripts\4th\grounddown.sqs"]
floor1 player addaction ["1st Floor","\wizbuid\scripts\4th\1stfloor.sqs"]
floor2 player addaction ["2nd Floor","\wizbuid\scripts\4th\2ndfloor.sqs"]
floor3 player addaction ["3rd Floor","\wizbuid\scripts\4th\3rdfloor.sqs"]
floor5 player addaction ["5th Floor","\wizbuid\scripts\4th\5thfloor.sqs"]
floor6 player addaction ["6th Floor","\wizbuid\scripts\4th\6thfloor.sqs"]
floor7 player addaction ["7th Floor","\wizbuid\scripts\4th\7thfloor.sqs"]
~0.0001
floor8 player addaction ["8th Floor","\wizbuid\scripts\4th\8thfloor.sqs"]

deaddog

  • Guest
Re:AddAction/RemoveAction problem
« Reply #9 on: 08 Aug 2003, 22:44:13 »
You forgot the = sign:  floor0 = player ...... :)

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:AddAction/RemoveAction problem
« Reply #10 on: 09 Aug 2003, 00:14:24 »
O  YER SHIT LOL :D ;)