Trigger Damage Problem
Moderator: Core Staff
Re: Trigger Damage Problem
thank you very much!
Works fine.. <3
Just a few questions for this script..
Is it possible to get hit indicator?
Is it possible to get a red crosshair?
Is it possible to take away the deagle after level 3 if the person dont have it before?
Are there more changes in radiant then the conncects between trigger and brushmodels?
Works fine.. <3
Just a few questions for this script..
Is it possible to get hit indicator?
Is it possible to get a red crosshair?
Is it possible to take away the deagle after level 3 if the person dont have it before?
Are there more changes in radiant then the conncects between trigger and brushmodels?
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Trigger Damage Problem
[Note: Line numbers may not be correct as I was changing script while updating this post]ekat wrote:thank you very much!
Works fine.. <3
Just a few questions for this script..
Is it possible to get hit indicator?
Is it possible to get a red crosshair?
Is it possible to take away the deagle after level 3 if the person dont have it before?
Are there more changes in radiant then the conncects between trigger and brushmodels?
Hit Indicators:
This is stock code, but include it in your mod, because I think CJ mod disables it.
Code: Select all
Â
// Place the following line as the first thing inside "main()"
precacheShader("damage_feedback");
Â
// Put the following call after "//set up player" - line 144 in my script.
user thread hitmarker();
Â
// Put the following lines inside "target_think" after the if statement - line 230
user playlocalsound("MP_hit_alert");
user.hud_damagefeedback.alpha = 1;
user.hud_damagefeedback fadeOverTime(1);
user.hud_damagefeedback.alpha = 0;
Â
// Put this function at bottom of script
hitmarker()
{
    if(!isDefined(self.hud_damagefeedback))
    {
        self.hud_damagefeedback = newClientHudElem(self);
        self.hud_damagefeedback.horzAlign = "center";
        self.hud_damagefeedback.vertAlign = "middle";
        self.hud_damagefeedback.x = -12;
        self.hud_damagefeedback.y = -12;
        self.hud_damagefeedback.archived = true;
        self.hud_damagefeedback setShader("damage_feedback", 24, 48);
        self.hud_damagefeedback.alpha = 0;
    }
}
Code: Select all
// Add the following after "// Set up player loadout" - line 159
user.lastWeapon = user getCurrentWeapon();
Â
// Add this to FIRST if statement - Line 196
// This will remove the weapon on every eventuality fail/pass
user takeWeapon("deserteagle_mp");
user switchToWeapon(user.lastWeapon);
And the changes are simple adding a common targetname and linking each target brush to their respective trigger using the "target" key.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Trigger Damage Problem
That works great!
Just one last thing..
What did i have to change to make the trigger_damage to an array?
I want to make better targets but therfor i need 7 trigger for each target..
http://s14.directupload.net/images/130425/w9cs3xpj.jpg
I already created them but because its getEnt i cant start it..^^
Thank you very much for all your amazing help!
Just one last thing..
What did i have to change to make the trigger_damage to an array?
I want to make better targets but therfor i need 7 trigger for each target..
http://s14.directupload.net/images/130425/w9cs3xpj.jpg
I already created them but because its getEnt i cant start it..^^
Thank you very much for all your amazing help!
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Trigger Damage Problem
Select all the brushes you want, right-click 2D window and select "script<brushmodel".
If you deselect the model, you can now press "SHIFT+ALT", then click any of the individual brushes. This will select all the brushes that make the brushmodel.
Now simply press "n" and add you targetname.
When done in this way, all the individual brushes will be treated as a single entity in game.
If you deselect the model, you can now press "SHIFT+ALT", then click any of the individual brushes. This will select all the brushes that make the brushmodel.
Now simply press "n" and add you targetname.
When done in this way, all the individual brushes will be treated as a single entity in game.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Trigger Damage Problem
ok but i cant connect the brushmodel to the trigger..
And how to make the same shit with all the triggers?
Because i need 7 brushmodels and 7 trigger for each target.. o.O
And how to make the same shit with all the triggers?
Because i need 7 brushmodels and 7 trigger for each target.. o.O
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Trigger Damage Problem
You can connect any entity to any other entity, select the trigger, then select your brushmodel and press W. They should now be connected.
You'll have to use the clipping tool('X' key on your keyboard) to make your trigger look like that. Create the trigger using 1 brush, then clip it properly. Personally I had a lot of trouble trying to make the trigger work when I made it out of multiple brushes.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
Re: Trigger Damage Problem
ye i know that thanks!Rezil wrote:You can connect any entity to any other entity, select the trigger, then select your brushmodel and press W. They should now be connected.
Thats how i make the screen!Rezil wrote:You'll have to use the clipping tool('X' key on your keyboard) to make your trigger look like that. Create the trigger using 1 brush, then clip it properly.
So its not possible and i have to use a square trigger?Rezil wrote:Personally I had a lot of trouble trying to make the trigger work when I made it out of multiple brushes.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Trigger Damage Problem
It is perfectly possible and incredibly easy to do.
Create your shape.
Select all the parts.
"Script<Brushmodel"
(Give it targetname + target)
Create the same shape and give it trigger texture.
Select all the parts.
"Trigger<Trigger_damage"
(Give it targetname)
You cannot "link" the brushmodel to the trigger by having all the parts selected, you should only have one section of trigger selected - or even easier, just type "key:target value:targetname_of_trigger" and they will link together.
I have attached a map with a very slightly modified version of your script.
Create your shape.
Select all the parts.
"Script<Brushmodel"
(Give it targetname + target)
Create the same shape and give it trigger texture.
Select all the parts.
"Trigger<Trigger_damage"
(Give it targetname)
You cannot "link" the brushmodel to the trigger by having all the parts selected, you should only have one section of trigger selected - or even easier, just type "key:target value:targetname_of_trigger" and they will link together.
I have attached a map with a very slightly modified version of your script.
You do not have the required permissions to view the files attached to this post.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Trigger Damage Problem
Drofder you are my hero..Drofder2004 wrote:It is perfectly possible and incredibly easy to do.
Thank you very much!
Now everything is working and looks good..
Video:
What exactly is modified in this version of my map/script?Drofder2004 wrote:I have attached a map with a very slightly modified version of your script.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Trigger Damage Problem
Very little.ekat wrote:What exactly is modified in this version of my map/script?Drofder2004 wrote:I have attached a map with a very slightly modified version of your script.
Mostly adjustments were made to ignore parts of your script (secrets) but the main change was "randomint(target.size)" - this allows for more than 4 triggers and obviously my targets rotated instead of moved.
Glad you got it working, however there is so much more you can do to improve this - but that is obviously up to you
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Trigger Damage Problem
Thats bad, i need the parts with secrets, book and more..^^Drofder2004 wrote:Mostly adjustments were made to ignore parts of your script (secrets)
U need the book to use the secret and if u finish all 3 level u get secret +1 for the final secret..
That sound great!Drofder2004 wrote:but the main change was "randomint(target.size)" - this allows for more than 4 triggers
I was thinking of let them fall down and stand up!Drofder2004 wrote:and obviously my targets rotated instead of moved.
Any Ideas?Drofder2004 wrote:Glad you got it working, however there is so much more you can do to improve this
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Trigger Damage Problem
You can do various types of target and easily adapt it into the code with very little change.
One easy way of doing this:
For each different style of target, add a KEY:VALUE of "script_noteworthy" and a value of your choosing.
So, if you had a moving target:
Key: script_noteworthy
Value: moving_target
Now, in your code:
The example above uses 3 targets, 2 of the targets pop out from the walls and the third is standard.
You just add your own case and how it reacts. So different wait times, different actions (combine movement maybe?)
--
Generally, mapping could also be improved - such as lighting, textures of target, fx, etc
One easy way of doing this:
For each different style of target, add a KEY:VALUE of "script_noteworthy" and a value of your choosing.
So, if you had a moving target:
Key: script_noteworthy
Value: moving_target
Now, in your code:
Code: Select all
switch(targets[currentTarget].script_noteworthy)
{
    case "right":
        targets[currentTarget] rotateyaw(90, 0.2);
        wait (2 / (user.target_level + 0.3));
        targets[currentTarget] rotateyaw(-90,0.1);
        break;
    case "left":
        targets[currentTarget] rotateyaw(-90, 0.2);
        wait (2 / (user.target_level + 0.3));
        targets[currentTarget] rotateyaw(90,0.1);
        break;
    case "down":
        targets[currentTarget] rotateroll(90, 0.2);
        wait (2 / (user.target_level + 0.3));
        targets[currentTarget] rotateroll(-90,0.1);
        break;
}
wait 1;
You just add your own case and how it reacts. So different wait times, different actions (combine movement maybe?)
--
Generally, mapping could also be improved - such as lighting, textures of target, fx, etc
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Trigger Damage Problem
I love this idea!KillerSam wrote:Civilian targets that look almost the same - but it's GG if you shoot one
Good idead too! Will look into it!KillerSam wrote:You could also make it so that you need to get a certain point score with a scoring system
I will maybe play a bit arround with the targets but i dont want to make it to hard because its just a little piece of a big secret+bonus for my jump map...Drofder2004 wrote:You can do various types of target and easily adapt it into the code with very little change.
One easy way of doing this:
For each different style of target, add a KEY:VALUE of "script_noteworthy" and a value of your choosing.
So, if you had a moving target:
Key: script_noteworthy
Value: moving_target
Now, in your code:The example above uses 3 targets, 2 of the targets pop out from the walls and the third is standard.Code: Select all
switch(targets[currentTarget].script_noteworthy) { Â Â Â Â case "right": Â Â Â Â Â Â Â Â targets[currentTarget] rotateyaw(90, 0.2); Â Â Â Â Â Â Â Â wait (2 / (user.target_level + 0.3)); Â Â Â Â Â Â Â Â targets[currentTarget] rotateyaw(-90,0.1); Â Â Â Â Â Â Â Â break; Â Â Â Â case "left": Â Â Â Â Â Â Â Â targets[currentTarget] rotateyaw(-90, 0.2); Â Â Â Â Â Â Â Â wait (2 / (user.target_level + 0.3)); Â Â Â Â Â Â Â Â targets[currentTarget] rotateyaw(90,0.1); Â Â Â Â Â Â Â Â break; Â Â Â Â case "down": Â Â Â Â Â Â Â Â targets[currentTarget] rotateroll(90, 0.2); Â Â Â Â Â Â Â Â wait (2 / (user.target_level + 0.3)); Â Â Â Â Â Â Â Â targets[currentTarget] rotateroll(-90,0.1); Â Â Â Â Â Â Â Â break; } wait 1;
You just add your own case and how it reacts. So different wait times, different actions (combine movement maybe?)
Thats why there is "user.secret4=true;" and "user.secrets++;" in this script..^^
I think the textures of my targets (see video) are cool..Drofder2004 wrote:Generally, mapping could also be improved - such as lighting, textures of target, fx, etc
But thats just my opinion..^^
ofc i will look into good textures, lights and more on my jumpmap!
But at the moment, thank you all for your great help!
You are my heroes!
Who is online
Users browsing this forum: No registered users and 1 guest