Home   Help Search Login Register  

Author Topic: TaXI Script  (Read 1522 times)

0 Members and 1 Guest are viewing this topic.

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
TaXI Script
« on: 19 Oct 2005, 12:02:27 »
ok, so, i know there is a script like that, but i didn't find it...
so can someone make me a script, let's say u enter a car, then u click on the map and the certain car will drive over there.
if u r not in the car u can't click on the map and the car will drive to there.
and the dude under me, your script isn't working
« Last Edit: 20 Oct 2005, 19:23:19 by RolsRois »
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:TaXI Script
« Reply #1 on: 19 Oct 2005, 22:26:17 »
carname exec "taxi.sqs"

Code: [Select]
_taxi = _this
#loop
@player in _taxi
onmapsingleclick {_taxi domove _pos}
@!(player in _taxi)
onmapsingleclick {}
goto "loop"

not garuneteed, and a very basic idea, but if this is what you want(and it works ::) ) i could spruce it up a bit for ya

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:TaXI Script
« Reply #2 on: 20 Oct 2005, 18:19:36 »
RolsRois,

You have been taken to task previously about consecutive posting.
Please use the Modify button to edit your previous post rather than post again.


Planck
I know a little about a lot, and a lot about a little.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:TaXI Script
« Reply #3 on: 21 Oct 2005, 02:23:33 »
and the dude under me, your script isn't working

i wonder if you realize just how useless that is to me...

whats happens? do you get an error message? describe how you set everything up. give me something to work with, plz.

oh, and another thing, i like being called by name, ty

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Re:TaXI Script
« Reply #4 on: 21 Oct 2005, 12:33:56 »
Sorry, Triggerhappy.
look, The script is fine, but it does nothing, there is not an error messege or something.
i meen im in the car, im pressing on the map and it does nothing.
really, so, can u fix the script and plz try it 1st?

Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:TaXI Script
« Reply #5 on: 15 Nov 2005, 01:38:42 »
okay, a shot in the dark.

for every car you want to be a taxi, add this in their init line:
Code: [Select]
this addEventHandler ["init",{(_this select 0) exec "taxi.sqs"}]
and use triggerhappy's script.

I don't know why it doesn't work for you though.

try this. It's a longer version, but it might make it work:

Code: [Select]
;named taxi.sqs
_taxi = _this
#loop
? (player in _taxi) : goto "InTaxi"
? !(alive _taxi) : exit
goto "loop"

#InTaxi
onMapSingleClick {_taxi domove _pos}
~1
onMapSingleClick {}
goto "loop"
that might do it.

[EDIT]: Script is untested. If that doesn't work, please let me know what happened etc.
« Last Edit: 15 Nov 2005, 01:48:03 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:TaXI Script
« Reply #6 on: 15 Nov 2005, 01:48:26 »
An improved script, so I posted it seperate...
Code: [Select]
;named taxi.sqs
_taxi = _this
_taxiOnMove = false

#loop
? (player in _taxi) : goto "InTaxi"
? !(alive _taxi) : exit
? (unitReady _taxi) : _taxiOnMove = false
~1
goto "loop"

#InTaxi
? (_taxiOnMove): goto "loop"
onMapSingleClick {_taxi domove _pos}
~1
onMapSingleClick {}
_taxiOnMove = true
goto "loop"
Syntax not guareteed. All I did was add a check to see if the taxi was at the new place so that the player did not constantly get onMapSingleClick prompts and inadvertently use one. Also added a delay on the loop so that it doesn't absorb memory like no other.  ;D The '@' condition doesn't allow for multiple values to be tested simultaneously.
« Last Edit: 15 Nov 2005, 01:50:50 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Re:TaXI Script
« Reply #7 on: 15 Nov 2005, 12:41:18 »
THANKS ALOT!
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:TaXI Script
« Reply #8 on: 15 Nov 2005, 13:58:18 »
Does it work?
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Re:TaXI Script
« Reply #9 on: 15 Nov 2005, 19:45:27 »
o well o well o wello...
just tested it, it doesnt work... maybe im using it all wrong,
can u make an exmaple mission or something? and fix the script? thanks
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:TaXI Script
« Reply #10 on: 15 Nov 2005, 23:07:17 »
Yeah, I'm working on it. I'm on a breakthrough, but it can only be used once so far. I'll post it later if I fix it.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:TaXI Script
« Reply #11 on: 18 Nov 2005, 19:41:13 »
Put this in every car's init:
Code: [Select]
this addEventHandler ["get in",{[(_this select 0)] exec "taxi.sqs"}]

And for taxi.sqs.
Code: [Select]
;named taxi.sqs
_taxi = _this
onMapSingleClick {_taxi doMove _pos; onMapSingleClick {}}

That should do it. I realized it didn't need to  be that fancy...
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline RolsRois

  • Members
  • *
  • I'm not sure of who i am anymore
    • Rambm Workshop
Re:TaXI Script
« Reply #12 on: 19 Nov 2005, 18:50:52 »
thanks ill try it out
Rambm Workshop, A New way of playing OFP
http://www.freewebs.com/rambm/
yes its on freewebs! Got a problem?