Vehicle Power... In theory...

So, I have been playing with a CTF map and I have had an idea which I shall not bore you with. But the question I have is, while playing with vehicles I noticed this dynamic field

selfPower = "1";

I tried to create a group of vehicles powered by a generator, by changing this field to "0" and placing all the vehicles in an isolated simgroup with a gen. But nothing interesting happens when the gen goes down so...
1). How do we take advantage of this field and create generator dependent vehicles?

2). If this can work... what happens to people in the vehicle when the gen goes down? (auto-eject would be nifty)

3). I am interested in learning some more advanced scripting... or basic scripting for that matter. Any volunteers to sit down and gimme some pointers, on IRC or whatever? (you people know who you are)

> Red, if this works there will be a map out there that you can destroy the gen and disable any vehicle in play on the opposing team! Won't that be fun huh?

Comments

  • getting rid of vehicles always makes the game better
  • neat idea, but i believe it could be done.
    Make a mission-side package (so that it only runs when the map is played) to add a ::onDestroyed function to disable vehicles for the team. also you'll need to add a function to handle if a user tries to get in a disabled vehicle.

    Just remember to make the map server-side so people will actually play it :)
  • Okay... super, that doesn't really answer any questions as to how and, what kind scripting needs to be done. I am only vaguely familiar with scripting in general. And as a general rule I try and make all maps server side. So scripters is there a way to call that sort of function in a .mis contained script? have vehicles powered by a gen which, when disabled, all vehicles will eject players and stop functioning until the generator is repaired?
  • Generator onDisabled foreach vehicle in MissionCleanup if !selfPower doDismount powered=0
    Vehicle onMount if !powered return

    Paraphrased of course. Add some syntax and a package, and that's about it.
  • I might be able to muddle through that, check back in a few days when I can wrap my head around that!
  • Your questions have been answered. It's possible and easy - all it takes is a package with 3 or 4 short functions. If you still need more help, you should consider asking someone to just write the whole script for you. I think Red Shifter writes map scripts all the time for mappers who don't know anything about scripting.
  • Okay, I have tried to string things together in a way that might work, but without knowing what functions can be used where I fear I am at a loss, could one of you fabulous scripters out there piece this together for me? I have been trying all day on and off but I can't figure it out. Here is My best guess I know I'm off, but I get the feeling I'm not TOO far off so please help.
  • SO... can um, someone throw Me a frikkin bone?
  • if(!%selfPower = 0)
    	{
    	  %obj.doDismount
    
    need to be
    	if(!%obj.selfPower)
    	{
    	  %obj.doDismount();
    

    to compile and run correctly.
    Note that I just glanced at it, so I prob missed something.
  • thank you for looking at it Heat, I understand scripters get harrassed a lot. I'll try this modification and see if yields Me any results
    I am serious as well about seeing if someone here will show Me a little bit about tribes scripting. The only thing I understand is the format, and as you can see... that understanding isn't great. Somewhere there is a rather in depth tutorial for torque engine scripting, but it has no real bearing on the functions called in T2.
  • thank you for looking at it Heat, I understand scripters get harrassed a lot. I'll try this modification and see if yields Me any results
    I am serious as well about seeing if someone here will show Me a little bit about tribes scripting. The only thing I understand is the format, and as you can see... that understanding isn't great. Somewhere there is a rather in depth tutorial for torque engine scripting, but it has no real bearing on the functions called in T2.
    if you wanna pm me ur mis file with the script package i could try and get it working sometime soon. i got nothin else goin on haha
  • ...
    move the vehicles out of the Vehicle SimGroup and into the MissionCleanup SimGroup. The solar panels don't have the added variable so it doesnt 'shut down' the vehicles. And I believe you didnt put all the vehicles 'team' var correctly.
  • edited August 2010
    errr oops, I remade the vehicles and put them in that sim group to copy and paste to mission cleanup.. apparently I forgot. Will double check team variables.


    ----FIXED
  • I think this falls more into the area of mods, rather than map behavior. Regardless, I think the best way to do it is to track which vehicle station spawned each vehicle, and use the vehicle station power status to control the power status of vehicles spawned from that station.

    As for powering them down, the most realistic looking thing would be to replace them with a wheeled vehicle of the same shape. It would give you reasonably realistic falling and collision physics, but would require a new datablock for each vehicle. If you go with the datablock approach, this firmly falls into mod territory.
  • I think this falls more into the area of mods, rather than map behavior. Regardless, I think the best way to do it is to track which vehicle station spawned each vehicle, and use the vehicle station power status to control the power status of vehicles spawned from that station.
    there are so many ways to approach this idea. When writing it it first went with attaching vars to each vehicle that spawned about it being powered or not, then I took a more simplified approach with global vars. I did think about tracking each vehicle by its station but then that would involve a lot more coding and, yes, I think it would be more of a mod.
    As for powering them down, the most realistic looking thing would be to replace them with a wheeled vehicle of the same shape. It would give you reasonably realistic falling and collision physics, but would require a new datablock for each vehicle. If you go with the datablock approach, this firmly falls into mod territory.
    I could do this, but it wasnt requested ;)
  • edited August 2010
    The script actually works exactly the way I had asked, vehicles are dependent upon a generator that, when destroyed will boot any occupants of said vehicles, and return the message "vehicle is not powered" if someone tries to mount it while gen is down. The only thing he hasn't implemented is to reset the vehicles recharge rates when the generator is down, which as I understand it is in the works.
Sign In or Register to comment.