logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic UnCause event request (Read 487 times)
Leo T_C_K
Betatester
Offline



Posts: 1968
Joined: Aug 27th, 2005
Gender: Male
UnCause event request
Jun 30th, 2016 at 6:21am
Print Post  
Yes, just like there's the causeevent command, there should be uncauseevent...

zeurkous requests:
Quote:
"Please add this to Engine.PlayerPawn:

exec function UnCauseEvent( name N )
{
     local actor A;
     if( (bAdmin || (Level.Netmode == NM_Standalone)) && (N != '') )
           foreach AllActors( class 'Actor', A, N )
                 A.UnTrigger( Self, Self );
}

Thanks,

     --zeur."
  

People who accuse others of trolling are usually the biggest trolls themselves.
Back to top
YouTube  
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7359
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: UnCause event request
Reply #1 - Jul 2nd, 2016 at 6:16pm
Print Post  
good point, I think.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 792
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: UnCause event request
Reply #2 - Jul 2nd, 2016 at 6:34pm
Print Post  
The suggested implementation is rather old-fashioned. This is how CauseEvent is defined in 227:

Code
Select All
exec function CauseEvent( name N )
{
	if ( Level.NetMode==NM_Client )
	{
		Admin("CauseEvent"@N);
		Return; // We are a client, pass it to server.
	}
	if ( Level.Game.GetAccessManager().CanExecuteCheatStr(Self,'CauseEvent',string(N)) )
		TriggerEvent(N,Self,Self);
} 


The first part simplifies use of the command for server admins - they are not required to prefix it by "Admin" explicitly.

Use of access manager allows mods to allow or reject the command depending on special permissions (unlike bAdmin).

Finally, there are utility functions TriggerEvent and UnTriggerEvent that may simplify the code.
  
Back to top
 
IP Logged
 
Leo T_C_K
Betatester
Offline



Posts: 1968
Joined: Aug 27th, 2005
Gender: Male
Re: UnCause event request
Reply #3 - Jul 2nd, 2016 at 7:01pm
Print Post  
This implementation was written with mind with the old code without modifications of course. I only checked whether there was UnCauseEvent already or not and when I found not, I posted this.

I had no idea there was triggerevent and untriggerevent in there but zeur wrote his own without knowing about yours. This is his declaration and I dunno how similar it is to the one you're refering to.

Code
Select All
function int TriggerEvent(Name N, Actor A, Pawn I); // returns the count of Actors actually triggered
function int UnTriggerEvent(Name N, Actor A, Pawn I); // idem
 

  

People who accuse others of trolling are usually the biggest trolls themselves.
Back to top
YouTube  
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 792
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: UnCause event request
Reply #4 - Jul 4th, 2016 at 10:09am
Print Post  
Leo T_C_K wrote on Jul 2nd, 2016 at 7:01pm:
This is his declaration and I dunno how similar it is to the one you're refering to.

See Engine.Actor

Code
Select All
// Trigger helper functions.
final function TriggerEvent( name Action, optional Actor Other, optional Pawn EventInstigator )
{
	local Actor A;

	if( Action=='' )
		return;
	foreach AllActors(Class'Actor',A,Action)
		A.Trigger(Other,EventInstigator);
}
final function UnTriggerEvent( name Action, optional Actor Other, optional Pawn EventInstigator )
{
	local Actor A;

	if( Action=='' )
		return;
	foreach AllActors(Class'Actor',A,Action)
		A.UnTrigger(Other,EventInstigator);
} 


I don't know when exactly they were added, but the latest public patch (227i) includes them.

Quote:
// returns the count of Actors actually triggered

That doesn't look useful. Many actors just do nothing when their Trigger function is called. F.e. if you execute "CauseEvent boatride" on level NaliBoat, a lot of PathPoint actors (PathPoint0 - PathPoint32) will be "triggered" along with the ObjectPath actor, but the ObjectPath actor is the only one that actually does something observable when triggered using this tag matching.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo