Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 118 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: trigger_hurt + brushmodel
acedlol
General Member
Since: Jul 19, 2011
Posts: 18
Last: Aug 6, 2011
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Tuesday, Jul. 19, 2011 08:56 am
Did a quick search, couldn't find anything.

Basically, I have a rotating brush in my map. Its a spinner and when a player gets close to this brush, I want them to die using the trigger-> trigger_hurt.

However radiant doesn't allow for the trigger_hurt to be scripted using the script_brushmodel.

Is there anyway around this, such as the 'kill texture' for example? Whatever it is, it needs to be able to rotate alongside the normal brush.

Thanks, aced.

[cry]

Share |
acedlol
General Member
Since: Jul 19, 2011
Posts: 18
Last: Aug 6, 2011
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Tuesday, Jul. 19, 2011 02:19 pm
Here's the situation picturised. :D



The rotating arm itself, and the 16x16 origin texture brush have these settings, and rotate fine.



The rotating script: (from the wikimods website)


main()
{
rotate_obj = getentarray("rotate","targetname");
if(isdefined(rotate_obj))
{
for(i=0;i {
rotate_obj thread ra_rotate();
}
}
}

ra_rotate()
{
if (!isdefined(self.speed))
self.speed = 10;
if (!isdefined(self.script_noteworthy))
self.script_noteworthy = "z";

while(true)
{
// rotateYaw(float rot, float time, , );
if (self.script_noteworthy == "z")
self rotateYaw(360,self.speed);
else if (self.script_noteworthy == "x")
self rotateRoll(360,self.speed);
else if (self.script_noteworthy == "y")
self rotatePitch(360,self.speed);
wait ((self.speed)-0.1); // removes the slight hesitation that waittill("rotatedone"); gives.
// self waittill("rotatedone");
}
}

I need to move the trigger_hurt with it. Pretty sure all I have to do is link it to the rotating arm, however I am no grandmaster at scripting.

Thanks,

Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 Scripting
Posted: Tuesday, Jul. 19, 2011 04:43 pm
I can think of two ways to do this: link the trigger to the brushmodel or just kill the player if he's touching the brushmodel.

First method:
Code:
{
brushmodel = getEnt("spinner","targetname");
trigger_hurt = getEnt("pain","targetname");

trigger_hurt EnableLinkTo();
trigger_hurt LinkTo("brushmodel");

brushmodel rotateYaw(360, 10);
}
In Radiant, name your brushmodel spinner and your trigger_hurt pain.
If that doesn't work, try this:
Code:
{
brushmodel = getEnt("spinner","targetname");
brushmodel rotateYaw(360, 10);
players = getEntArray("player","classname");
for(i=0, i<players.size, i++)
players[i] thread checkTouch(brushmodel);
}
checkTouch(spin)
{
level endon ("disconnect");
level endon ("death");

while(1)
{
if (self isTouching(spin))
self suicide();
wait 0.1;
}
}
This should cause a player to commit suicide if he's touching the spinner.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»