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

Members Online

»
0 Active | 91 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 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Triggered FX
HarkoninVSC
General Member
Since: Jan 25, 2008
Posts: 294
Last: Apr 24, 2008
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 03:02 pm
Ok the title some what states the problem.

I have been working on a script that basically plays an effect when a player walks into a trigger.

Heres the setup.

I have a body of water, very low. I have a trigger just above the water line. The trigger is a trigger_multiple named splashtrigger.

Now my script is called from the main.gsc with the typical

maps/mp/_splash.gsc::main();

I have entries in both my .gsc and .csv for "footstep_water"
located in fx/impacts.

Ok all the basics covered no issues there.

I believe it is either a problem with the trigger_multiple or in the actually coding of the script.


Code:

main()
{
thread define_scripted_splash();
}
define_scripted_splash()
{
splashfx = loadfx ("impacts/footstep_water");/////<---load and name effect
splashtriggers = getentarray("splashtrig","targetname");////<--defining the trigger
for(i=0;i<splashtriggers.size;i++)
splashtriggers[i] thread splash_think(splashfx);
}splash_think(splashfx)
{
self waittill("trigger",player);/////////////<---waiting for player to enter trigger
if(isAlive(player))///////////////-<checks if player is alive
{
pos = player getorigin();/////////////<---where to spawn FX
playfx(splashfx,pos);/////////////////actual spawn of FX
}
}




Ok so the script works.....sort of. No errors in compilation or load. It does play the effect when a player first walks into the trigger, but does not again. Basically its a one time deal.

My question here is this, how to make it repeat for as long as the player is in the trigger and every time it is triggered.

Thanks Hark.
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 03:17 pm
Code:

main()
{
thread define_scripted_splash();
}

define_scripted_splash()
{
splashfx = loadfx ("impacts/footstep_water");
splashtriggers = getentarray("splashtrig","targetname");
for(i=0; i < splashtriggers.size; i++)
splashtriggers[i] thread splash_think(splashfx);
}

splash_think(splashfx)
{
while(1)
{
self waittill("trigger",player);
if(isAlive(player))
{
pos = player getorigin();
playfx(splashfx,pos);
}}}


That puts it into a very quick loop, if you want it slower then you can add a
wait 1;
or something, above the self waittill() line.
Share |
HarkoninVSC
General Member
Since: Jan 25, 2008
Posts: 294
Last: Apr 24, 2008
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 03:43 pm
It's still only firing once, perhaps some way to see if the trigger or script is failing?

I'm thinking a hint string for the trigger and a iPrintLn for the script to see where the fault is.
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 03:48 pm
Hmm, the trigger itself shouldn't be the problem unless you've added a delay to it in Radiant, have you definitely updated the fastfile? It sounds stupid, but everyone's done it [tongue]

I'd just use iPrintLn's and see what happens.
Share |
HarkoninVSC
General Member
Since: Jan 25, 2008
Posts: 294
Last: Apr 24, 2008
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 03:57 pm
I'm not getting a hint from the trigger, and my script text is only appearing once.

Trigger is only a tigger_multiple with a targetname of splashtrig. Fast file and zone have been updated.
Share |
HarkoninVSC
General Member
Since: Jan 25, 2008
Posts: 294
Last: Apr 24, 2008
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 04:06 pm
I'm wondering if this would work at the end of the script.

releaseclaimedtrigger(self);

Wasn't there a function to reset triggers on off states?
Share |
SpeedHighway
General Member
Since: Apr 30, 2005
Posts: 494
Last: Apr 9, 2008
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 04:21 pm
No, I don't think that will work. The trigger would need to be claimed first.

He forgot to mention another problem. If we put the script into a loop with while(1) when it comes back around to the waittill the second time, it accuses player of being undefined. Perhaps someone has an idea on that?
Share |
Bloodlust
General Member
Since: Apr 7, 2004
Posts: 101
Last: Jan 14, 2015
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 04:48 pm
see if this helps:


main()
{
level._effect["splashfx"] = loadfx ("impacts/footstep_water");
trigger = getent("splashtrig","targetname");

while(1)
{
trigger waittill("trigger", who);

if(isAlive(who))
{
pos = who getorigin();
playFX(level._effect["splashfx"], pos);
}

wait 0.4;
}
}
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 05:03 pm
By the way, trig_multiples don't give you hints, I think.
Share |
HarkoninVSC
General Member
Since: Jan 25, 2008
Posts: 294
Last: Apr 24, 2008
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Tuesday, Mar. 11, 2008 05:03 pm
We got it YAY!

heres a screenshot ->


http://68.197.222.14:3000/vetserver/screens/shot0067.jpg


http://68.197.222.14:3000/vetserver/screens/shot0067.jpg

edited on Mar. 11, 2008 01:05 pm by HarkoninVSC
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

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

»