Home   Help Search Login Register  

Author Topic: Help guys, simple question  (Read 1040 times)

0 Members and 1 Guest are viewing this topic.

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Help guys, simple question
« on: 16 Oct 2005, 16:05:11 »
ok so, i made a mission, now i made a bike that u can buy, the trigger next to the bike goes like this:
Condition:Money >= 100
Activition: buybike = dude (he is the player) addaction ["buy bike 25$","buybike1.sqs"];
so the script goes like this, and the bike's name is bike1 lol..
Code: [Select]
;this unlocks the car
bike1 lock False
;this stops the trigger being activated again
Buybike1 = False
;this takes away the cost ofthe car from the players total money
Money = Money - 25
;this makes _money the same as Money for the next line of script
_Money = Money
;this brings up a message showing us how much money the player has
hint format ["Players Money is %1$", _Money]
dude removeaction buybike1
~2
Hint "Thanks For Buying! Come Again!";

so i get this annoying thing that whouldn't switch off the action from the player, it says something like
'dude removeaction buybike1
  • 'Excepcted bowl

something like that, raelly annoying thing, can someone tell me how do i get rid of it and how do i remove this annoying action from the player?
please comment; :-X
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Help guys, simple question
« Reply #1 on: 16 Oct 2005, 16:26:25 »
Excepcted bowl... ;D

I think its expected Bool.

Anyway:
If u do:buybike = dude addaction ["buy bike 25$","buybike1.sqs"]
then U remove the action with:dude removeaction buybike
while U do:dude removeaction buybike1

or try dude removeaction (_this select 2)
http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Re:Help guys, simple question
« Reply #2 on: 16 Oct 2005, 16:51:57 »
i was wrong writing it i guess, it was
Activition: Buybike1 = dude addaction ["BUy Bike 25$","buybike1.sqs"]; and not
Activition: Buybike1 = dude addaction ["BUy Bike 25$","buybike1.sqs"];.
so anyway thanks for ur help, but its not an answer u just wrote what i wrote in the script..
can anyone help me up?
thanks
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:Help guys, simple question
« Reply #3 on: 16 Oct 2005, 17:32:24 »
You are probably trying to use the same name for two different variables?

A boolean variable with a name "Buybike1":

Code: [Select]
Buybike1 = False
...and then you have a variable containing the action's ID with a name "Buybike1":

Code: [Select]
Buybike1 = dude addaction ["BUy Bike 25$","buybike1.sqs"]
...
...
dude removeaction buybike1

That messes your script totally because you are giving the removeAction command a boolean variable instead of an action ID which it is expecting to get. Make sure you do not use the same name for two different things.

The error message comes from your trigger because you have added the action and then you give the action ID to the trigger as condition, which should instead be a boolean variable and that's why you get an error message "Expected: bool".

(And remember, OFP variable names are case insensitive so you can't have different variables named var and Var because they mean the same to OFP.)

« Last Edit: 16 Oct 2005, 17:39:08 by Baddo »

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Re:Help guys, simple question
« Reply #4 on: 16 Oct 2005, 17:43:59 »
i didn't know that and im not sure cause one, Buybike1 = false makes sure i wont use that trigger again, and removeaction buybike1 makes the player to remove this praticelur action from the actions menu
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:Help guys, simple question
« Reply #5 on: 16 Oct 2005, 17:47:01 »
In your script, buybike1 isn't anymore pointing to the added action in the moment when you try to remove the action but it is set to "false" which doesn't help at all, you have lost the action ID at that point and thus can't remove the action anymore with "dude removeaction buybike1".
« Last Edit: 16 Oct 2005, 17:48:41 by Baddo »

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:Help guys, simple question
« Reply #6 on: 16 Oct 2005, 17:54:36 »
Simply put, make sure you use different names for the variable holding the action ID and the variable for a boolean value used in your trigger. From what you have told us, it seems like you have a variable naming conflict at your hands.

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Re:Help guys, simple question
« Reply #7 on: 16 Oct 2005, 18:04:09 »
my bad, can u write the script in a fixed way please? it whould help a lot
here is the wrong one:
Code: [Select]
;this unlocks the car
bike1 lock False
;this stops the trigger being activated again
Buybike1 = False
;this takes away the cost ofthe car from the players total money
Money = Money - 25
;this makes _money the same as Money for the next line of script
_Money = Money
;this brings up a message showing us how much money the player has
hint format ["Players Money is %1$", _Money]
dude removeaction buybike1
~2
Hint "Thanks For Buying! Come Again!";
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Re:Help guys, simple question
« Reply #8 on: 16 Oct 2005, 18:30:01 »
OMG! U RULE! U RULE! I TRIED WHAT U SAID AND IT'S TRUE, SORRY FOR ARGUEING WITH U, U RULE!!!!!!!!!!!!!!!!, tell me ur adress so i can send u cookies
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re:Help guys, simple question
« Reply #9 on: 16 Oct 2005, 18:30:34 »
Its not the script you need to change, its the actionID. So, instead of

Quote
Buybike1 = dude addaction ["BUy Bike 25$","buybike1.sqs"]
You've got....
Quote
Someothername = dude addaction ["BUy Bike 25$","buybike1.sqs"]

Also, in your script, replace
Quote
dude removeaction buybike1
with...
Quote
dude removeaction someothername

And you ought to be in the zone....

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:Help guys, simple question
« Reply #10 on: 16 Oct 2005, 18:46:11 »
 ::)

:thumbsup:

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:Help guys, simple question
« Reply #11 on: 16 Oct 2005, 18:50:31 »
 ::)

:thumbsup:

Thanks Gogs for clarifying more what I meant.

RolsRois, it would probably be a good idea to get familiar with OFPEC TAG's because your global variables are lacking a TAG and that can lead to more problems with variable names (which can be harder to spot than this one).

#EDIT oops one post too much.
« Last Edit: 16 Oct 2005, 18:51:20 by Baddo »