Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 3

Warning: include(http://map.planetmedalofhonor.gamespy.com/mohaa/poll/poll_cookie.php): failed to open stream: no suitable wrapper could be found in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 3

Warning: include(): Failed opening 'http://map.planetmedalofhonor.gamespy.com/mohaa/poll/poll_cookie.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 3
.map :: Mapping for MoHAA

 
IRC :: #.map on Quakenet.org or simply go to irc://irc.quakenet.eu.org/.map
 

 
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 57

Warning: include(http://map.planetmedalofhonor.gamespy.com/mohaa/leftindex.php): failed to open stream: no suitable wrapper could be found in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 57

Warning: include(): Failed opening 'http://map.planetmedalofhonor.gamespy.com/mohaa/leftindex.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 57
 
 

Scripted Exploders :: Wombat
-------------------------------------------------------------------------------

This tutorial assumes some basic knowledge, of the use of MohRadiant. We will build a map, that can be played ingame, from the Multiplayer Menu. This enables the user to fully understand, how exploders are set-up, and then expand that knowledge, to the scripting of objective maps, utilizing the scripts that come with Mohaa.

The first script to be used, will be the exploder.scr in the global folder in your Mohaa/main folders. Do not worry if you do not have the folder, as it is inside the Pak0.pk3 file, which is just a zip file, so open it with WinZip or WinAce and view the files. It would be advisable to extract at least the Pak0.pk3 file to a folder (preferably 'Mohaa/main/'), as it will make the selection of models easier.

First we need to build a basic room (read the first room tutorial), for a multiplayer map. Having built the room, it is time to add the items. Right click the mouse in the view window (not the camera view) and select 'info/player/start'. This will be our Spectator start position (in Multiplayer maps). Do the same for a 'info/player/ allied' and 'info/player/axis' followed by a 'light' or two.

The first entity to add will be a scripted_object, again right click in the view window and select script/object.

Press the 'N' key for eNtity, and bring up the entity console ( Sometimes it pays to deselect the entity and then select again [press shift and click entity]). We need to set up the object. First set the targetname as exploder, and the '#set' as 1 ,by typing the key [targetname] and the value [exploder] into the text fields. Next we need to select the model that the scripted object is to display. Either press the model button and search for the desired model, or just type in the path. (Note, if you extracted the pak0 file to a different directory, then the path must be cleared of everything before models/statweapons/flak88turret.tik or the editor will not display the model, and mohaa will not load it. You can also change the direction the object faces, by clicking the angle buttons, or type angle[key] and (value in degrees)[value].( I have found that if you do not deselect first, then the object may not draw in the direction set, but angle 0 instead.)

Now we need to add another scripted object. First we need to press 'Esc' to de-select the other object. Now add a script object and targetname as explodersmashed, same #set number (1), and the model of models/statweapons/flak88_d.tik . This is the destroyed model, and needs to be placed in the same place as the exploder. Occupying the same space. Next we add a script model. Set the targetname as exploderfire, and the #set as 1. Select 'models/emitters/explosion_mine.tik' model. Move the entity to the position you want the emitter to work from ie: under the gun.

The exploder script, allows for projectiles to shoot out of the explosion. you set this up by adding another script object. Give it a targetname of exploderchunk, #set as 1, and (for this tutorial) I used the models/projectiles/bazookashell.tik model. Next we add a script origin. This gives us a point to shoot the projectile towards. Deselect all objects. select exploderchunk first, then holding shift still, click on the script origin. Both should be selected(the order of selection is important). Now press 'CTRL k' to join the exploderchunk to the script origin. You should see a blue line( with an arrow pointing in direction of travel). The editor assigns a targetname to the script origin, and sets the target in the exploderchunk. Repeat the above for as many projectiles as you need.

Soon, it will get a little crowded, and it seems, as though you just can't select that object. You can of course still access the object if you know the targetname you gave it. Select Menu--Edit/Entity Info. Then by clicking on each script_object, you get info on that object. Keep going until you get to the one you want, then click select and then close (close gadget doesn't work). Now the object is selected , it can be manipulated.

 

Another way to select groups of objects, is too draw a box around the objects, that completely encloses the objects. Then choose the Menu---Selection/Select Inside. All the objects should be selected.

 

Next we need to set up a trigger, which will set off the bomb. Add a trigger/use entity and set it as triggerable( won't work otherwise). Next set the setthread[key] to explode_my_bomb[value] and we are almost there. Move the trigger to a place where you will be able to remember where it is (they are invisible ingame).

 

Save the map as exploder_tutorial.map. Compile the map (Bsp,Vis and Light). Copy the exploder_tutorial.bsp, exploder_tutorial.scr and exploder_tutorial_precache.scr to your mohaa/main/maps/obj folder.

Start the game , select Multiplayer, then select start (not join) game, and select objective maps. Next select maps/exploder_tutorial. Next click start. If the exploder has already gone off, when you start the map, then you may not have everything set correctly.

You can load the exploder_tutorial.scr file into Notepad then view the basic setup for a Multiplayer map. The main part, that we are interested in is the usage of the exploder.scr script. You must run the exploder script, when you first start your map, as it has to set-up all the Sets of exploders, as well as hide all the destroyed models. I put it as the first line after the main: tag. Next we told the trigger to setthread explode_my_bomb which is a thread inside exploder_tutorial.scr script file. When the trigger is used ( default 'e' I think) then this script is run.

explode_my_bomb:
iprintlnbold_noloc "Bomb has been set , 10 seconds to detonation"
wait 2
iprintlnbold_noloc "8"
wait 2
iprintlnbold_noloc "6"
wait 2
iprintlnbold_noloc "4"
wait 1
iprintlnbold_noloc "3"
wait 1
iprintlnbold_noloc "2"
wait 1
iprintlnbold_noloc "1"
wait 1
exec global/exploder.scr::explode 1
iprintlnbold_noloc " The bomb will go off again, but no swapping of models"
end

The 'iprintlnbold_noloc' command sends the text to the screen as a message under the compass ,ingame. Wait, waits for the specified time in seconds. Then the exploder script is called by the line

exec global/exploder.scr::explode 1

which means EXECute the global/exploder.scr script, specifically the EXPLODE thread, sending a parameter of 1 ( the set you want to blow up ).

In the next tutorial, we explore the usage of the obj_dm.scr script, as we try to set up objectives. Go to Setting Up Objectives.


Need any help : Ask in the Forum

 


 
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 372

Warning: include(http://map.planetmedalofhonor.gamespy.com/mohaa/rightindex.php): failed to open stream: no suitable wrapper could be found in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 372

Warning: include(): Failed opening 'http://map.planetmedalofhonor.gamespy.com/mohaa/rightindex.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 372


 


Warning: require(): open_basedir restriction in effect. File(/home/map/cgi-bin/mohaa/poll/include/config.inc.php) is not within the allowed path(s): (/var/www/vhosts/own3mall/mohaaaa.co.uk:/usr/share/php:/usr/share/pear) in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 383

Warning: require(/home/map/cgi-bin/mohaa/poll/include/config.inc.php): failed to open stream: Operation not permitted in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 383

Fatal error: require(): Failed opening required '/home/map/cgi-bin/mohaa/poll/include/config.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/scripted_exploder.php on line 383