Buzz MINITANKS!

Discussion in 'Scripting' started by Buzz_Litebeer, Jun 14, 2003.

  1. Buzz_Litebeer Private

    Contributions:
    15
    I have a new mod coming out that will allow players to drive little mini tanks around maps and fight others in mini tanks! all dependent on the whim of the administrator, and without the need to have all the players on the map to download anything, it will be serverside only!

    Hell, with the scaling option, you can even have tanks small enough to pilot on stalingrad!

    anyway, here are some teaser pictures

    Here is a perspective picture to get an idea of the size of a default mini tank, shown is a normal sized tank, and a player.
    [IMG]

    A picture of a minitank spawned on southern france

    [IMG]


    Me driving the mini tank on southern france
    [IMG]


    Me Shooting at someone on southern france, he is also in a mini tank.


    [IMG]

    ANyway, I now have the ability to arbitrarily spawn them, and arbitrarily spawn AI that can follow path and follow complex instructions. IE drive around the map, shoot players by team, potrol an area against all players. drive to a point on a map tehn let a player jump in once it has reached its node.

    etc ...

    Buzz OUT

    (OH I STILL NEED HELP, THE TANK TURRET CAN BE SEEN THROUGH THE WALLS!)
  2. Buzz_Litebeer Private

    Contributions:
    15
    oh and the reason tehy are mini tanks is because full sized tanks dont work well on maps
  3. jv_map Flight Engineer

    Contributions:
    121
    Specialties:
    Mapper, Modeler, Scripting, Textures, Programming
    Processing:
    Graphics:
    Looks like fun :) Nice work.
  4. Buzz_Litebeer Private

    Contributions:
    15
    weird thing is you can actually drive them around relatively easily on stalingrad.

    IE up stairs and such without clipping out of the map.

    Next thing I have to write is a spawner code, IE so they can be given out arbitrarily to players.

    THE AI code stuff is already working. I have AI for teh tanks. Soon I will write an AI for the mini tanks so that you can have bot matches with the tanks on a map.

    IE you kill a tank, it will respawn 10 seconds later and start roaming the map looking for you, at least That is the PLAN

    Right now I have a pretty good "AI" that just follows nodes around where I tell it to, and fires at whatever team i tell it to

    FFA, axis, allies

    but for the mini tanks I might do a little edit of the AI that it will follow nodes that will lead it closes to the player.

    hehe
  5. Virussss Private

    Contributions:
    4
    yeh nice work!! ... couldnt you display a hud when the player enters the tank , like scorpio did with the planes , and make a really nice view of a tank .. lol :)
  6. [3Fsj]Gdf.SniperMonkey Private

    Contributions:
    5
    wow! That looks awesome! So, how will these become avalible for the player to use? Do you spawn them, or start out with them or what?
  7. Snake Better then you.

    Contributions:
    31
    He wants it to be serverside so I would think no because scorpios planes have pituces of the cockpit :(
  8. Sawed_Off Private

    Contributions:
    8
    lol thats sweet
  9. Trent Gillespie Administrator

    Contributions:
    200
    Specialties:
    Mapper, Scripting, Textures, Support
    Processing:
    Graphics:
  10. Buzz_Litebeer Private

    Contributions:
    15
    Well I re-wrote a chunk of Small Sumos MP tank tutorial to work with the in game tanks, then i re-wrote the following tikis

    teh tigertank.tiki
    tigertankcannon
    panzer_tank
    its cannon tiki

    and the king tank tiki, and tookt eh ubersound.scr from the map fix that has the tank drive around destroyed villiage.

    Remember, my mod isnt strictly just for drivable mini tanks, its an encompassing AI modification (eventually I want it to be able to spawn anything and load an AI onto it, IE air planes etc).

    SO i had to be a littel carefull how i edited the tiki files.

    When I got that done, I spawn the tanks, and then i give the tanks to a player after I prep them to take damage etc.

    Currently (as of right now)

    I have to spawn the tnaks manually. How I do this is i fly to where I want to spawn the tank, tehn I tell it to spawn there hehe.

    Then I use a MAM command (everything is integrated with MAM guyts sorry) to give the tank to someoen.

    So far I have had 7 mini tanks fighting without crashing the server ;-)

    I also had a "war" where I loaded 4 "big" tanks up wiht my AI and the mini tanks had to detsroy the "big" tanks, that was fun too ;-)
  11. Trent Gillespie Administrator

    Contributions:
    200
    Specialties:
    Mapper, Scripting, Textures, Support
    Processing:
    Graphics:
    Spawn the fookers then let us play it :)
  12. Virussss Private

    Contributions:
    4
    wow cool nice work!!! .. does this mean someday there will be fully functional AI in mp :) .. like climbing ladders and stuff? .. lol if u get bored spawn a bot or two :) would be cool in MAM that would :) ... all this tank stuff is still server side right?
  13. Buzz_Litebeer Private

    Contributions:
    15
    maybe....

    THE AI will be for registered bots and such, the problem is, I took a look at jv_maps bots, and they were freaking insane, SO if someone were to make a bot AI kinda thing, I would definately want JV_Bots Help, and If he would e-mail me I would be spanketificly happy lol.
  14. memphis Corporal

    Contributions:
    6
    could we have mini mini tanks just the right scale to a player model? So that they become super small? Now that would be awesome!
  15. corporalpunishment Private

    Contributions:
    4
    Mini tanks are cool

    I have also experimented with mini tanks. We played with the players not hidden so you can see the torso of the player stick up out of the tank. Great for snipers.

    I also had player giants. I made a skin where there was some crazy texture issue and they spawn in game as giants. The clipping was normal so you could still get through the vent in V2.
    The player was huge about the size of the V2 rocket.

    Mini players would be funny with a full server
  16. Buzz_Litebeer Private

    Contributions:
    15
    I have anohter mod that sorta prevents me from setting player scale. the idea of my mod is to make everyhting serversided.

    I would love to exchange code, if you PM me with your e-mail i can send you my code, its a global AI controller, all the tank stuff is just an example of the power of the global AI controller.

    The mini tank thing will be seperate from that.


    I also have a node maker algo, that will write out what you have to add to your map into your qconsole.log file, im still working on that part but it should be working soon ehhe.


    oh and a qucik question, when the person leaves the game, is the crashing due to the script running on it, or the fact that the player left...


    IE if i just regularly attatched the player to the tank, with no AI running on it, would it crash if he left the server?
  17. Buzz_Litebeer Private

    Contributions:
    15
    I fixed the person going to spectator thingy... kinda weird, now this makes no sense to me....

    If a player goes to spectator, then is told to get out of the tank (how i fixed spectator problem), the tnak can then be used by other players by hitting hte use key next to the tank..

    now you may say "but buzz thats in the script"

    but im going to tell you this, its not in MY script. IE i dont have anyting at the moment that will let a player "jump into" the tank, so being able to jump into the tank was a weird thing for me lol.
  18. _CH_Avenger Private

    Contributions:
    1
    If this could all be done server side would it be possible to spawn smaller players in turn allowing for map makers to theoretically make massive maps for the smaller players? This would allow for some really massive maps if it is while still getting some real great fps.

    This could really make for some interesting options. Just think of the size of maps that you could get allowing jeeps, tanks, airpolanes, whatever may be the case with a bunch of smaller sized players running around a massive map.
  19. corporalpunishment Private

    Contributions:
    4
    Hmmm

    Now I could be wrong (I have a habit of that) but the testing I did was with all MP maps I could find with useable vehicles.

    Whenever a player had control (Flak88, Jeep or Tank) and they left the game, the server would crash.

    I hope someone proves me wrong, but that was my experience.
  20. Buzz_Litebeer Private

    Contributions:
    15
    I wish you were wrong, but you are not, I have beat my head on that thing for a while and still couldnt figure out how to detatch them from the tank before they left the game.

    The onyl way to do it would be to "catch" the game call that someone does when they are disconnecting then detatch them ebfore the they exit the game.

    sadly cant do that ;(

    anyway

    Just because I know you will be interested, I discovered how to make the tanks take damage from grenades.

    Here is the code snippet.

    Code:
    _trigSet local.type local.wtime local.action \
    	local.x1 local.y1 local.z1 \
    	local.x2 local.y2 local.z2 \
    	local.thread \
    :
    	thread level.mam_f_utils::debug 0 "_trigSet |" local.type "|" \
    				local.wtime "|" local.action "|" \
    				local.x1 "," local.y1 "," local.z1 "|" \
    				local.x2 "," local.y2 "," local.z2 "| -------"
    
    	switch ( local.type )
    	{
    	  case "trig_touch":
    	  case "trig_use":
    	  case "trig_fire":
    	  case "trig_mg":
    		local.trigObj = spawn trigger_multiple 
    		break
    	  case "trig_tank":
    		{
    		local.trigObj = spawn trigger_multiple "message" "dear god I was hit" "spawnflags" "128"
    		local.trigObj.health = .01
    		if(self != NULL)
    		{iprintln "glued"
    			local.trigObj glue self
    			self.trigobj = local.trigobj
    			local.test = self.targetname
    
    		//iprintln self.targetname
    		//iprintln local.test
    		}
    		}
    		break
    	  default:
    		end
    	}
    
    
    
    
    	local.x1 = float( local.x1 ) ; local.x2 = float( local.x2 )
    	local.y1 = float( local.y1 ) ; local.y2 = float( local.y2 )
    	local.z1 = float( local.z1 ) ; local.z2 = float( local.z2 )
    
    	// Make sure coords are in right order
    	if ( local.x1 > local.x2 )
    	{
    		local.x = local.x1 ; local.x1 = local.x2 ; local.x2 = local.x
    	}
    	if ( local.y1 > local.y2 )
    	{
    		local.y = local.y1 ; local.y1 = local.y2 ; local.y2 = local.y
    	}
    	if ( local.z1 > local.z2 )
    	{
    		local.z = local.z1 ; local.z1 = local.z2 ; local.z2 = local.z
    	}
    
    
    	//iprintln ( ( local.x2 local.y2 local.z2 ) - \
    	//				  ( local.x1 local.y1 local.z1 ) )
    
    	local.trigObj.origin = ( local.x1 local.y1 local.z1 )
    	local.trigObj setsize ( 0 0 0 ) ( ( local.x2 local.y2 local.z2 ) - \
    					  ( local.x1 local.y1 local.z1 ) )
    
    	local.trigObj delay ( float( local.wtime ) )
    	if ( level.mam_debug > 80 )
    		local.trigObj message \
    				( "I'm in brush #" + local.trigObj.entnum )
    	local.trigObj setthread "_trigAction"
    	local.trigObj.ham_type = local.type
    	local.trigObj.ham_action = local.action
    	local.trigObj.thread = local.thread
    	local.trigObj.wtime = local.wtime
    
    	local.trigObj.x1 = local.x1
    	local.trigObj.y1 = local.y1
    	local.trigObj.z1 = local.z1
    	local.trigObj.x2 = local.x2
    	local.trigObj.y2 = local.y2
    	local.trigObj.z2 = local.z2
    
    	if(local.test != NULL)
    	{
    		local.trigObj.obj = self.targetname
    		local.trigObj.prevhealth = self.health
    	}
    
    	for ( local.i = 1; local.i <= level.mam_sv_maxclients; local.i++ )
    	{
    		local.trigObj.ham_team[ local.i ] = ""
    		local.trigObj.ham_time[ local.i ] = 0
    	}
    end
    
    //----------------------------------------------------------------------------
    
    _trigAction:
    	local.player = parm.other
    /*
    	iprintln "i am a trigger!"
    	iprintln self.health
    	iprintln self.size
    	self.health = 1
    	iprintln  self.health
    	self spawnflags "128"
    */
    	if ( ( self.ham_type == "trig_use" ) &&
    	     ( ! local.player.useheld ) )
    		end
    	if ( ( self.ham_type == "trig_fire" ) &&
    	     ( ! local.player.fireheld ) )
    		end
    
    	local.playerId = local.player.entnum + 1
    
    	thread level.mam_f_utils::debug 80 "Trig: Player #" local.playerId \
    						"  brush = " self.entnum \
    						"  action = " self.ham_action
    
    	local.team = self.ham_team[ local.playerId ]
    	local.time = self.ham_time[ local.playerId ]
    
    	if ( ( local.team != "" ) &&
    	     ( local.team != local.player.dmteam ) &&
    	     ( ( level.time - local.time ) < 30.0 ) )
    	{
    		local.tmChange = 1
    	}
    	else
    	{
    		local.tmChange = 0
    		self.ham_team[ local.playerId ] = local.player.dmteam
    		self.ham_time[ local.playerId ] = level.time
    	}
    
    	if ( self.ham_type == "trig_mg" )
    	{
    		if ( local.tmChange == 0 )
    			end
    	}
    
    	switch ( self.ham_action )
    	{
    	  case "hurt1":   local.player hurt 1 ; break
    	  case "hurt5":   local.player hurt 5 ; break
    	  case "hurt10":  local.player hurt 10 ; break
    	  case "hurt25":  local.player hurt 25 ; break
    	  case "hurt50":  local.player hurt 50 ; break
    	  case "die":	  local.player hurt 10000 ; break
    	  case "kill":    local.player kill ; break
    	  case "respawn": local.player respawn ; break
    	  case "weapnext":local.player weapnext ; break
    	  case "weapdrop":local.player weapdrop ; break
    	  case "holster": local.player safeholster 1 ; break
    	  case "stand":	  local.player modheight stand ; break
    	  case "duck":	  local.player modheight duck ; break
    	  case "thread":  self thread self.thread local.player ; break
    	  default:	  local.player stufftext self.ham_action ; break
    	}
    	//thread resetme
    	//self remove
    end
    
    tankdamage local.player:
    
    local.tank = $(self.obj)
    
    //iprintln self.health
    //iprintln local.tank.health
    
    if(local.tank == NULL)
    	{
    		iprintln "removing myself"
    		self remove
    		end
    	}
    if(self.prevhealth == local.tank.health)
    {
    iprintln "nade damage"
    local.damage = self.health * -1
    local.tank damage local.player local.damage local.player local.player.origin local.player.origin local.player.origin 0 0 "explosion" -1
    }
    
    //iprintln local.tank.health
    
    local.tank thread _trigSet "trig_tank" 0 "thread" self.x1 self.y1 self.z1 self.x2 self.y2 self.z2 "tankdamage"
    
    self remove
    end
    
    now in the prep tank code, directly "after" the preptank is called

    self preptank

    i add this line of code after

    self.health = 2000

    Code:
    
    self thread _trigSet "trig_tank" 0 "thread" self.origin[0] self.origin[1] self.origin[2] self.origin[0] self.origin[1] self.origin[2] "tankdamage"
    
    I use an edited version of my bud Hammer, Hammers goodies, trigger snippet, since his code allows the trigger stuff to be so dynamic.

    Basically the "key" parts to making it damagable, and for you ttlrude in reply to that year old post on 1 shot damage triggermulitple, is that

    1. you keep the state of the object calling your trigger.

    I do that with local.trigObj.obj = self.targetname

    2. When the trigger dies (ie its used up that one time like trigger mults do) you respawn the trigger based on the state info kept over from the previous trigger.

    That can be done local.trigObj.x1 local.trigObj.y1 etc... (IE if you dont move the thing)

    3. Glue the trigger to the object your running around with

    I do that with local.trigOjb glue self

    4. In the case of grenades I just made the trigger so small it could not be hit by projectile weapons! that was the final trick, I couldnt make the trigger immune to anything (though if you know how to make it immune tell me cause i wuold rather do that and have more control)

    I made it VERY small, so only an explostion would hurt it.

    5. The next thing is I keep track of how much health waslost.

    since i set the triggers health to a mere .01, whatever damage it takes goes negative, so thats how much damage it took.
    ( I am actually going to make it 2 times the nade damge, since the nade can never get "close" enough to do "real" damage IE it does small fractions of damage)

    6. Keep track of the previous health, why? well this is done because the trigger takes damage from ANY explosion, including rocket launchers and other tanks... but it doesnt take damage from grenades...

    so What i do is check to see if its health went down, if it did then I know it was hit by an explosion OTHER than a grenade, if it didnt go down, it must have been a grenade that did the damage.

    Next thing for me to do is to make it damagable by team as well. IE if g_teamdamage is set to 1, and the driver is is on the same team, it wont do any damage to the tank.

Share This Page