I already had a tutorial for this on ZM for about 2 weeks, and some people might have seen it in the "Christmas with the Joker" map by WhippyTrout ( wich was also on NGT btw! and is a very cool and very custom map!). In that version the site's remained empty after searched. I updated that tutorial and added random respawning, so i decided i'd post it here as well.. Anyways, cut the BS. here's the tut:
Download the files at the end of this post (contains the script, the dollar sign model & materials and the files for the walther-pistol + upgraded one) offcourse, you dont have to use the walther if you dont want to...
1-First download the files and extract them. Copy the contents of the "copy to raw folder" into your \game_root\raw\ folder, and copy the contents of the "copy to mods mapname folder" into the \game_root\mods\name-of-the-map-to-install-to\ (example: nazi_zombie_factory ). These files also contain the files for the walther pistol, and an upgraded version. It doesn't contain any fx or sounds since this tut is using stock fx and sounds so you should be fine if you havent messed with those.
NOTE: the weapons i included in the crates are stock WaW weapons, if you're using UGX-MOD open up _dig_site.gsc AFTER completing this tutorial, search for the gun_reward() function and change the weapons to UGX weapons!!!!!
2-Open your mapname.gsc file (you can find it in \raw\maps\), copy it into your mods\mapname\maps\ folder. --->if your using UGX-MOD it's already in your mods/mapname folder<---- Open it and find the line:
above this line you add:
and below this line you add:
An example of how it should look (your mapname.gsc might look diffent, so don't copy this code!)
example BEFORE:
example AFTER EDITING:
NOTE: I included the walther pistol and an upgraded version in this download because i felt there had to be more crappy pistol's inside the crate's.. You obviously don't need to use it if you don't want to, in that case you can continue with step 7. Keep in mind when you skip step 3-6 entirely the script is NOT ready for use and you need to go inside _dig_site.gsc after completing this tut, and change the rewards that spawn for the gun-crate's so the walther doesn't show up anymore... I left note's in the _dig_site.gsc file on where to make any changes so that shouldn't be to hard at all.
3a- ONLY FOR NON UGX-MOD USERS (if you're using ugx-mod follow step 3b and ignore this one) : next open up dlc3_code.gsc (copy from raw\maps\ to your mods\mapname\maps folder ) and find the part that says 'include_weapon( "zombie_colt" );' etc. etc. right below all these include_weapon lines add these:
3b- FOR UGX-MOD USERS: open up ugx_mod.iwd (with winRAR) open the maps folder, and edit _zombiemode_weapons.gsc in there (make a backup!!!).
find all the line's that say:
and below these line's add these two: Change the first "false" entry IN THE FIRST LINE ONLY to "true" if you want the walther to appear in the random-box
Save and close. When closing the file you'll be asked if you want to update the archive, CLICK YES!
4-FOR NON UGX-MOD users (if you're using ugx-mod skip this step and go to step 6 ): open up _zombiemode_weapons (copy from raw\maps\ to your mods\mapname\maps folder)
-next find the part that says 'add_zombie_weapon( "zombie_colt" .....' and where it add's all the weapons. Now pay attention here!
-if you DON'T want to add the wather as a BUYABLE WALL weapon follow option AAA (save's you a hintstring, because the limit for those seems kind of low..)
-if you DO want to make the Walther a buyable wall weapon follow option BBB.
---I intended the walther NOT to be a buyable weapon, so only way to get the gun/ammo is by power_ups or dig_site's that why i made it a bit more powerfull than for example the colt. It would be a 'rare' weapon and you would be pretty insane to PaP it. That's also why it does have a little kick to it.---
OPTION AAA - Add these lines somewhere in between the other weapon lines
--PROCEED TO STEP 6!--
OPTION BBB- Add these lines somewhere in between the other weapon lines
--PROCEED TO STEP 5!-- (note: the walther will cost 800, you can change this by changing EVERY 800 entry in this step AND IN STEP 5 as wel!!
5-go to "game_root\raw\english\localizedstrings\" and find the file "zombie.str". For this to work you can't copy the file to your mods\ folder (as far as i know) so edit it right where it is, but make a backup first! Open the "zombie.str" file and go to the bottom and add these line's:
6-The upgraded walther is the Walther P382.0 (i suck at making up names, i'm sorry) and it has "double tap 2.0". Meaning in this case: when you fire the gun you see the impact of 2 rounds, while it's a single shot. Also when you shoot a zombie once you get 2x 10 points. To make these changes
FOR NON UGX-MOD users: first open up _zombiemode_spawner.gsc (copy from raw\maps\ to your mods\mapname\maps folder before editing!)
FOR UGX-MOD users:open up ugx_mod.iwd and go to the maps folders, open _zombiemode_spawner.gsc from there, When done and closing the file you'll be asked if you want to update the archive, CLICK YES!
--find the function 'zombie_damage()' and scroll down a bit in this function till you see
right under that, add these lines:
next, scroll down some more till you see the function 'zombie_damage_ads()' and again right under
add these lines:
Save and close.
FOR NON UGX-MOD users.. Find _zombiemode_score (copy from raw\maps\ to your mods\mapname\maps folder )
FOR UGX-MOD users: open ugx_mod.iwd (with winRAR, make a backup!!) and edit _zombiemode_score in there, When done and closing the file you'll be asked if you want to update the archive, CLICK YES!
Next open up and you should be looking at the first function 'player_add_points' (if not, find this function) scroll down a bit till you see the 'switch( event )' and, some lines below that, the case declarations ( "case_death" , "case_damage" etc). Now add these 2 set's of lines right above the line that says 'default:' So to make sure: add both of these in between the lines 'break;' and 'default:'
save and close. That's it for the Walther!
7-go to your \game_root\zone_source\ folder and find yourmapname.csv Leave it where it is, so make a backup before editing. Open it and at the end add the following:
If you included the walther take the code from option A, if you decided NOT to include the walther follow option B.
--OPTION A--
--OPTION B--
NOTE: i put in the FX files for the bouncing_betty because i had previously deleted those from my dl3c.csv to avoid FX-limit error's. If you havent messed with any of the stock FX you could probably delete those last three line's saying: 'fx,weapon/bouncing_betty/...' NOTE2: If you're using UGX-mod you might need to add the FX for the der_riese style powerup-drop to appear correct!!!
That should be the scripting part, if you go to your \mods\mapname\maps\ folder and open up _dig_site.gsc you can edit pretty much anything. From point amounts that drop, to drop rates. change the weapons that drop etc. I left side note's in the script on what to edit where.
The Radiant part:
There are 4 different triggers working in this script, for all 4 goes the same: make the trigger a square box of 40x40x40 units and place it on the ground otherwise the models won't spawn in correct. All models (crate's and saw's use a randomized angle and wil just appear flat on the ground (or table or whatever). You don't need to place actual models, they spawn in through script. For all triggers make a 'trigger_use'.
-first one: Where the player can pick up a saw. A player can only carry 1 saw so no need to add more than 4, there is no limit however. assign these KVP's :
-second one: a normal crate that spawns random points, or an ammo refill for the player that finds it for the weapon he's holding, or a armed bouncing betty. There is no limit on how many you place.. assign these KVP's:
-third one: a special crate that spawn's a random powerup or a armed bouncing betty. Again no limit on how many you use. assign these KVP's:
-last one: a weapon crate that spawn's a 'random' weapon (see vid). Again no limit on how many you use. assign these KVP's:
At the beginning of a new round an empty crate has about 15% chance of respawning. If it does, it'll ignore the original script-noteworthy you gave it and spawns in random as either a special crate (10%) - weapon crate (5%) or a points crate (85%). At round 1 all crate's you placed will spawn in, and they will 'obey' the script-noteworthy you gave them.
That's all, remember to select all new files in the MOD-Builder when compiling!
CREDITS: Don Goony (hacker function implemented in this script), YaPhil (providing a fix for doing damage to the players) and BluntStuffy (that's me :CREDITS
If you implement this in your map, please give credit. Thanks! And if you'd send me a link or message when your map is released that would be great to!
I think i got pretty much everything covered, if you feel like i forgot something, or if you're having troubles with the files or the script. Let me know below
@BluntStuffy There is no difference in semantics and performance should be equal too. It kinda comes down to personal preference, although the explicit comparison of boolean variables with a boolean literal is considered unneccessary often. For example, the checkstyle tool, which does automated coding convention checks on Java code has an option to issue a warning if such explicit comparisons are used.
- Phil.
Thanks for taking the time to explain, appreciate it! and sorry for going a bit offtopic here, deadra!
i'm really NOT trying to be a smartass here, and i hope you don't mind i'm replying again. I'm just REALLY curious, Doesn't this:
have the exact same outcome as this:
why would you want to use the first over the last, is there any practical difference at all? (it's less typing i guess) I know that line isn't the issue anymore, like i said i'm just really curious
As far as i know the only way to make the hands do an animation is through the weapons files. So you'll probably need to create a weaponfile that uses your animation as an idle or raise animation. Then you can create a trigger in radiant and make that give the "weapon" to the player trough the script (so it plays the hands animation) and when the animation is done you take the "weapon" and give his orginal gun back. You can forget about my first post then, that's to call animations on models (like a forklift moving and lifting stuff or something like that)..
Either way it might be usefull just to look for those tut's on youtube and have a look, i'm sure it'll clear up a lot of questions.
this may sound like a cheap way of making the animation appear, but they actually did the perk drinking animations the same way. If you look in the sp/weapons folder you'll find the 'zombie_perk_bottle_jugg' file. and one for every other perk. You're looking for something similar, so you might be able to use that as a reference..
but I just relized that the viewhands actually is a model
Uh, ok. so you want the hands to do something after a trigger. Then i think you need to make a "weapon" animation without actually holding a weapon. and then have the trigger give that weapon to the player and it plays the raise animation. like they did with the drinking of the perks i believe. If i'm still not on the right page.. Just tell WHAT you want to happen, like:
sorry okey it is a viewhand animation, ---------------------------------------------------------------------- I want the viewmodel animation I have to be played after you have activated a trigger in my map.
So do you want the actual viewhands, or the viewmodel (wich is a gun model) to be animated? I'm confused
Not sure what you mean with animation, but an animation in CoD only tells the game wich bones to move where. So the animation you have must be a model with bones that is animated. If you have that, then you can export the model, animated model, and the animation from the same file. If you maya that is.. might be other ways, this is the one i know. But again, not sure what you mean with animation. Do you have like a movie you want to play ingame, or a moving model or something else? Not sure if we're on the same page
You need to call an animation on a model. And yes you need to convert them using AssetManager.
First you need an .xanim-export file and convert that with AssMan. if you use a custom model also convert that + its animated model make sure the model has a correct animtree (else create one) you call the animation through a script:
You'll need to call the animtree and _anim at the top of the script
then define the animation:
next you set the anim-name for the model
then define the animtree it uses:
after that u can use
to call the animation('s).
Quite some work, i don't really know what you mean by 'i've got an animation' but it needs to be in .XANIM-EXPORT format, or already converted for use in CoD (then it has no file extension). And you'll obviously also need a model that goes with the animation and preforms it, and an animated model of that same model. You could look on youtube and search for gun-animation tutorials. That works the same way (creating and converting the anim's etc), only with a model you need to make it work with a script...
I'd be willing to modify the soul chest script so you could use that. if you're interested send me a pm with what exactly your looking for and i'll take a look tomorrow..
Sweet! The first map i've seen with my "dig-sites" in it. Looking pretty awesome with all the custom models and texture's and stuff! Also watched the first episode on NGT, looked like they were pretty impressed! Awesome map! Merry Christmas !
1-First download the file from the end of this post and extract it. Copy the contents of the "copy to raw folder" into your \game_root\raw\ folder, and copy the contents of the "copy to mods mapname folder" into the \game_root\mods\name-of-the-map-to-install-to\ (example: nazi_zombie_factory ). The download contains the models, animations and animtree for the chest, soundalias files. The FX files and the script ofcourse. Choose one:
2-Open your mapname.gsc file (you can find it in \raw\maps\), copy it into your mods\mapname\maps\ folder. --->if your using UGX-MOD it's already in your mods/mapname folder<----- Open it and find the line:
above this line you add:
and below this line you add:
An example of how it should look (your mapname.gsc might look diffent, so don't copy this code!)
example before:
example after:
3a. FOR NON UGX-MOD users: if you're using UGX-mod got to step 3b and ignore this one!! Open (first copy to mods folder from raw/maps and/or make a backup!) your _zombiemode_spawner and find the line:
right below that line, add these:
next go all the way to the end of the file and add this:
save and close the file.
3B. FOR UGX-MOD users!!: Open ugx_mod.iwd (with winRAR) go into the maps folder and find your _zombiemode_spawner.gsc (make a backup!!!) Open it, and find the line:
right below that line, add these:
next go all the way to the end of the file and add this:
save and close the file. winRAR will ask you iff you want to update the archive, click yes for your changes to have effect!
4.-go to your \game_root\zone_source\ folder and find yourmapname.csv Leave it where it is, so make a backup before editing. Open it and at the end add the following:
That should be the scripting part. In radiant open your map. First we'll make the chest locations:
-create a trigger_radius and give that the KVP's:
Click the spawnflags "AI_AXIS" and "NOTPLAYER", Make sure it's flat on the floor. The chest will appear with it's center on the center of the trigger_radius. The arrow (when rotating the trigger) points to the front side of the chest. Adjust the radius and height for that trigger to suit your needs. Every zombie that dies touching that trigger will feed the chest.
-Next create a script-brushmodel and give it the "clip" texture. you want to make it about 104 units wide (x-axis) and 90 units 'long' (in the y-axis) make sure it's high enough so players can't get on top off it and MORE IMPORTANT: make it so the square box representing the trigger_radius you created in the previous step is COMPLETELY INSIDE the clip-brush. Once you did all that give the clip-brush the KVP's:
You can simply copy these two entities for all the chest's you want to make. The kvp's for all chests are the same. (the stock script supports up to 6 chest locations without any editing, although you might want to set the amount of kills yourself. You can do this in the _soul_chest.gsc file (i've marked where to edit stuff). Every chest can have it's own radius and height.
-Next create 4 triggers (don't make more, that may cause issue's) where the players can pick up their reward when done filling up all the chest's (the ray-guns in the stock script). Make those trigger_use and give the KVP's:
The center of the trigger is where the ray-gun appears. The amount of players in the game is equal to the amount of ray-guns that will spawn. A player can only pick up a free ray-gun once, if they already have a raygun if refills the ammo for it, once.
Things you want to know: -The standard time-out timer for a chest is set to 50 seconds, you can change this in _soul_chest.gsc -this is what the stock kill-requirements are, look for these lines to change them. You can change the kills required for each chest in _soul_chest.gsc.
-Dog's do not fill up chest's (so a dog round probably times out a chest, like the robots closed a chest in origins when standing on it) -When 2 or more chest's are activated at the same time, and one of them time's out and closes while other chest's are completed the amount of kills needed when reactivating the timed-out chest could have increased one level. I'll explain: Say: you got 4 chest's first one activated require's 4 kills second one require's 8 kills third require's 12 kills fourth require's 16 kills
*when you activated chest 1 and 2 at the same time, and finished both of them without time-out's. it took you 12 kills, right!
*now when you activate chest 1 and 2 at the same time and let ONE of them time out: -In the case the first chest you activated times out, and you completed the second one, that one took you 8 kills. now when you reactivate chest 1 (or another remaining chest) that one will also require 8 kills to fill instead of 4.
-When the second chest you activated timed out, nothing changes
That should be the worst case scenario, i decided to keep it that way. It could add some difficulty for players that are trying to fill multiple chest's at the same time and fail..
That's all, remember to select all new files in the MOD-Builder when compiling!
Also note, i have no scripting background whatsoever. I'm doing this for a few months now, and if i did things that are 'not done' or if you find any bugs please let me know. Happy mapping/modding!
If you use this tutorial for your map credit is appreciated, and it would maybe even be more appreciated if you would send me a link or message if your level is released. Would love to check out other map's with my script's in it!!