Jump to content

Check us out:

Submitter

SUPPORT TOPIC File Information

  • Submitted: Jan 02 2018 05:12 PM
  • Last Updated: Jan 02 2018 05:12 PM
  • File Size: 365.26KB
  • Views: 445
  • Downloads: 92

Download Powerups Test

- - - - -



POWERUPS TEST readme
raybanb@gmail.com
---------------------------------------------------------

I wanted to have some old style bobbing and rotating health/ammo like in old q3 days,
which et does not do. So to get around this i use a few different entities plus some
scripting to accomplish the same thing.

The map is just a test map, and the shader for it have nothing to do with the actual powerups.

In order to make these work, you will need to setup some entities and have scripting for them, which
i will explain how. plus you might need to add some definitions to your def file if you do not already have
them.


ENTITY SETUP
-------------------------------------------------------------------------------------

As an example, for a bobbing, rotating health box that gives 20 health,
you need to make a func_bobbing.. so make an origin brush, and a longer
brush that is used only to keep track of how high off the ground it will be
placed. that longer brush gets textured in common/nodraw-nonsolid so this
func_bobbing will not display anything in game.. yet.

we add some key/values for this func_bobber as follows,

classname func_bobbing
-------------------------------------
key value

model2 "models/multiplayer/rayban/powerups/health_slanty.md3"
height 16
speed 2
targetname health_bobber
scriptname health_bobber

-------------------------------------

so now this func_bobbing will display the slanted health box in game, bobbing at a good speed. we will
rotate it in the script later on to comeplete the effect.


NOTE** it is not nessessary to make the nodraw-nonsolid brush longer.. but its easier
that way to have a template of how high the origin brush should be above the ground so
your models does not dip into the ground. its just for ease of placement. and depending on
what model you use/create to use... it helps a lot to keep that longer placement brush.


We now need to add the actual powerup were going to use, and in this case we create an item_health
with the key/values as follows,

classname item_health ( there are a few to choose from, this one gives 20 health when picked up )
-------------------------------------
key value

model "models/multiplayer/rayban/powerups/powerup_dummy.md3"
targetname health_bobber_trigger
target health_bobber_script_trigger ( or do a ctrl-k to the target_script_trigger we will add in a moment )
spawnflags 1 ( you can select "suspended" also to get this, ignore the respawn/spin )

-------------------------------------

now what this does, is by default the item_health will display its own model, we don't want that becuase.. well, its
boring... we do not want that because it just sits there doing nothing.. it can be taken and used, but visually you
would be more entertained watching paint dry. so we use the powerup_dummy.md3 model to replace it, and what that
model does is nothing at all.. it wont show in game, and i'll explain why we do this further on.


we also need to add a target_script_trigger with the following key/values,

classname target_script_trigger
-------------------------------------
key value

targetname health_bobber_script_trigger ( we connect the item_health above to this, you could also use ctrl-k )
scriptname health ( we will use the script block "health" in our script )
target activate { we will call "trigger activate" in that same script block )

-------------------------------------


Now thats all done ( seemed like a lot, but it wasn't ) we select the item_health and place it in the same x/y of
the func_bobbing we made ( top down view ) since our item_health has the 'suspended' flag set, we can raise it off
the ground a bit if we want. and... were done. basicly thats it for the map, although i do recommend we place
a lightjunior above the func_bobbing, just to ensure there is proper lighting of a model that will be shown there.





SCRIPTING the whole mess together...
-------------------------------------------------------------------------------------

make your script, game_manager.. spawn.. blah blah ( hopefully we didnt forget to add a script_multiplayer entity )

game_manager
{
spawn
{
wait 500

// now since we gave the item_health a targetname, it will not appear in the game
// to start off with, so we need to alertentity it at the start to get it all working,
// so we do that in the game_manager spawn

alertentity health_bobber_trigger

// maybe you see now why i gave it the targetname of health_bobber_trigger, even though its
// an item, it has the functionality of activating any targets its pointed at.. so in essence
// its more of a health trigger, that gives you health.. but fires off a target you set once taken.
}
}

health_bobber // script block
{

spawn
{

wait 25 // now that this bobs up and down, we can
setrotation 0 150 0 // rotate it for effect.. a bobbing and rotating powerup model.
}


trigger activate // if this healthbox gets taken ( used ) , we then...
{
setstate health_bobber invisible // hide the bobber ( model ),
wait 5000 // we wait.. oh... 5 seconds for this test

setstate health_bobber default // then we reveal the healthbox again ( were respawning )
alertentity health_bobber_trigger // and we bring back the item_health so its ready
// to use again.

// once the item_health gets used, it's gone and wont respawn, so thats why we alertentity it
// to bring it back.. we basicly manually respawn it ( the health_bobber_trigger ) after a time
// of 5 seconds in this test.

}
}


and now we.. actually were all done. we now have a bobbing/rotating model of a slanted health box, that
has the functionality of giving us 20 health and dissapearing when we move into it, and respawning back
after 5 seconds. test out your map and see how it looks and works.

NOTE** for a list of models included and where they are, check the rayban_powerups_et.shader file.




Other files you may be interested in ..





  • 384 Total Files
  • 19 Total Categories
  • 38 Total Authors
  • 66,631 Total Downloads
  • Lays of Schwarzwald B1 Latest File
  • WuTang Latest Submitter