For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

I need a custom Trigger!

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
Post Reply
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

I need a custom Trigger!

Post by Krull0r »

Hello guys :)

Since I wasted my whole sunday in trying to create a trigger which calls 100 events at the same time on the map startup. I gave up and ask you for help.



I need such a trigger for fixing emitter triggering in multiplayer.
Image
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: I need a custom Trigger!

Post by gopostal »

I owe you K so email me and tell me whatever you need. I'll script it for you immediately: agutgopostal at gmail dot com
I don't want to give the end away
but we're all going to die one day
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: I need a custom Trigger!

Post by Masterkent »

a trigger which calls 100 events at the same time on the map startup.
100 events having different names? Why do you need so many?
I need such a trigger for fixing emitter triggering in multiplayer.
Could you elaborate on what exactly you want to achieve?
Last edited by Masterkent on Mon Dec 12, 2016 7:26 am, edited 1 time in total.
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: I need a custom Trigger!

Post by Krull0r »

There is a little annoying bug with the emitters.

There is no common way to trigger emitters in multiplayer.

for example. If you have an emitter that should be triggered by the player, let it be a smoke explosion after an earthquake or something like that. The effect is only shown up in the singleplayer.


I figured something strange out. If you trigger emitters with a stochastic trigger with the state "Always Active" the emitter triggering works also in multiplayer, but the stochastic trigger loops all outevents randomly.

(I often use the stochastic trigger method for slow flickering lights + a spark emitter effect.)

I also only need to call some triggered emitters at once on the startup of the map to get them work in multiplayer.



there is already a way to achive exactly that what I want.


dots made a scripted trigger. With this trigger I can add so many events and different actions as I want and fire them on startup.

BUT there is an other problem with this. When I use more then one scripted trigger in one map which have different jobs to do and export and reimport the map its the pure mess.... I have to resetup the whole scripted triggers again because the actions are all in a tumble on all Scripted triggers.


So I need a simple trigger like the RoundRobin that is easy to setup and fires different events at once on startup to avoid such a chaos and I often reimport my maps I'm working on to keep the filesize small or for different bug fixing.


Why I need so many... :) Actually In Vortex227 I have 25 triggerable emitters in the map. And I think some maps will need more then 25 triggered emitters :)



But maybe the better way is someone fixes the triggering behavior of the emitters in multiplayer 8-)


Image
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: I need a custom Trigger!

Post by Masterkent »

There is a little annoying bug with the emitters.

There is no common way to trigger emitters in multiplayer.
I didn't ever use emitters, but, as far as I can see, there are special emitter classes for network game: NetworkEmitter, NetworkBeamEmitter, NetworkMeshEmitter, etc. They transfer information about server-side calls to Trigger to network clients. What emitter classes do you use in your project?
I figured something strange out. If you trigger emitters with a stochastic trigger with the state "Always Active" the emitter triggering works also in multiplayer
I couldn't find anything special in StochasticTrigger that might affect network game.
I also only need to call some triggered emitters at once on the startup of the map to get them work in multiplayer.
If you want a reliably working solution, we should figure out what issues with network replication you have in the first place.
But maybe the better way is someone fixes the triggering behavior of the emitters in multiplayer
Even if some classes in Emitter.u don't offer a proper synchronization between client and server, you can write your own subclasses that would perform such synchronization.
Last edited by Masterkent on Mon Dec 12, 2016 12:06 pm, edited 1 time in total.
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: I need a custom Trigger!

Post by gopostal »

I played a bit with the new emitter classes when working on the dragons and they do require some settings to work properly online. I needed to assign them an owner when spawning them, stuff like that.

K, you might post a very small example map to let me server test privately. MK is surely right, there are simple settings that aren't getting properly assigned so they will then replicate across a server.
I don't want to give the end away
but we're all going to die one day
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: I need a custom Trigger!

Post by Krull0r »

I'll make a test map with three different setups when I come home. On the first setup I'm using normal emitters, the second will have those net emitters and the third setup will be pre triggered net emitters with a scripted trigger

I spend alot of times with a emitter setup maybe we can find the issue and figure out what i'm doing wrong.



Btw actually I use custom net emitters and i always test them in singleplayer and multiplayer.



@ gopostal

There are many things I need for my project I send you an email with all the stuff I need. :) thank you :)
Image
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: I need a custom Trigger!

Post by Krull0r »

http://wg1165843.virtualuser.de/unrealdev/Krullstuff/227MProject/NetworkEmitterTestMap.zip


Here it is.

First lane:       Normal Emitters.
Second lane:   Network Emitters.
Third lane:      Network Emitters with Scripted Trigger help.
Fourth lane:    Network Emitters triggered with Stochastic Trigger.


To trigger the emitters just fire with the dispersion pistol or what ever you have at the trigger Icons.

The fist cube on each lane enables and disables the emitter and the second cube in each lane spawns an amount of particles.



I have to mention that I use in this map the standard emitters without any custom stuff....
Last edited by Krull0r on Mon Dec 12, 2016 9:28 pm, edited 1 time in total.
Image
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: I need a custom Trigger!

Post by Krull0r »

Okay I figured out that it is a 227j bug!


I started a dedicated server, joined it and randomly Oblivion[CW] joined my server :)

He uses 227i and the "normal" network emitters are triggerable as client with out any pre triggering.



Big sorry for tripple posting.
Image
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: I need a custom Trigger!

Post by Masterkent »

Okay I figured out that it is a 227j bug!
227i has it as well. Now I tell what's going on.

Code: Select all

simulated function PostNetBeginPlay()
{
      if( TriggerAction==ETR_ToggleDisabled && (RepCounter & 1)!=0 )
            EmTrigger();
      ClientRepCounter = RepCounter;
      bNetNotify = True;
}
simulated function PostNetReceive()
{
      if ( ClientRepCounter!=RepCounter )
      {
            ClientRepCounter = RepCounter;
            if ( RepCounter==0 )
                  Reset();
            else EmTrigger();
      }
}

....

function Trigger( Actor Other, Pawn EventInstigator )
{
      if ( Level.NetMode!=NM_DedicatedServer )
            EmTrigger();
      if ( ++RepCounter==255 )
            RepCounter = 1;
}
If you connect to the server before triggering the emitter, then PostNetBeginPlay is not called, because all replicable client-side properties have actual values, so bNetNotify it not set to True, PostNetReceive is never called, and EmTrigger is never called.

If you connect to the server after triggering the emitter, then PostNetBeginPlay is called, because property RepCounter has been modified. PostNetBeginPlay may invoke EmTrigger, then it sets bNetNotify to true, this enables engine calls to PostNetReceive (which are supposed to check ClientRepCounter!=RepCounter and invoke EmTrigger).

So, what you need is to set client-side bNetNotify to true. There are several ways to do this. For example, you can define your subclasses of network emitters and override PostBeginPlay as follows:

Code: Select all

simulated event PostBeginPlay()
{
      super.PostBeginPlay();
      bNetNotify = true;
}
Last edited by Masterkent on Mon Dec 12, 2016 10:45 pm, edited 1 time in total.
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: I need a custom Trigger!

Post by Krull0r »

And it works ....  :-?

THANK YOU SO MUCH!

Since I made custom emitter presets I can fix all of them now!  :D
Last edited by Krull0r on Mon Dec 12, 2016 11:11 pm, edited 1 time in total.
Image
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: I need a custom Trigger!

Post by Masterkent »

That was only a part of the fix. This is what should be added in addition to the above:

Code: Select all

// the base class function is broken and useless
event PostNetBeginPlay() {}

simulated event PostNetReceive()
{
      if (ClientRepCounter != RepCounter)
      {
            if (RepCounter == 0)
                  Reset();
            else if (TriggerAction != ETR_ToggleDisabled || ((RepCounter - ClientRepCounter) & 1) != 0)
                  EmTrigger();
            ClientRepCounter = RepCounter;
      }
}
Note that PostNetReceive should distinguish odd and even number of updates of RepCounter anyway, because the client is only guaranteed to eventually receive the most recent value of a replicated variable, but it's not guaranteed to receive all updates of that variable whenever they take place. So, for example, when the server changes RepCounter from 0 to 1 and then from 1 to 2, the client may observe this sequence of changes as 0 -> 1 -> 2 or as 0 -> 2. In order to handle server-side double triggering with ETR_ToggleDisabled correctly and reliably, the implementation must handle even differences of RepCounter as non-triggering without relying on any intermediate updates of the variable.
Last edited by Masterkent on Tue Dec 13, 2016 10:38 am, edited 1 time in total.
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: I need a custom Trigger!

Post by gopostal »

Sorry to drop off this thread yesterday. Got called in on my day off, ended up working almost 11 hours :/ Bah humbug.

Thanks for the fix and the explanation MK. This will actually be useful in the reactive decos thing I'm playing with currently.
I don't want to give the end away
but we're all going to die one day
User avatar
dustinechoes849
OldUnreal Member
Posts: 480
Joined: Sat Feb 28, 2015 1:56 am

Re: I need a custom Trigger!

Post by dustinechoes849 »

humbug
"lincoln is pleased" -unreal 2
Image
Image
Image
Image
Image
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: I need a custom Trigger!

Post by Krull0r »

Yes really big thanks Masterkent! This fix should be included with the next 227j release!!
Image
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: I need a custom Trigger!

Post by Masterkent »

This fix should be included with the next 227j release!!
Then you can say goodbye to custom workarounds like this:

Code: Select all

var bool bEmit;

simulated event PostNetBeginPlay()
{
    // intentionally empty
}

simulated event Tick(float DeltaTime)
{
      if (Level.NetMode == NM_Client && RepCounter != int(bEmit))
      {
            EmTrigger();
            bEmit = bool(RepCounter);
      }
}

function Trigger( Actor Other, Pawn EventInstigator )
{
      if (Level.NetMode != NM_DedicatedServer)
            EmTrigger();
      RepCounter = 1 - RepCounter;
}
Having ETR_ToggleDisabled, this implementation should work under 227i because Tick would work alone (PostNetReceive is not enabled, because bNetNotify is false); however, after changing bNetNotify to true (as a part of the imaginary fix in 227j), we'd suddenly enable PostNetReceive and then PostNetReceive and Tick would mutually negate each other's effect. That is, 227j could break a valid 227i-compatible user-made subclass.

I don't see a simple resolution for post-227i. Ideally all existing emitter classes should be declared as deprecated and their proper replacements (without dividing into network-aware and network-unaware) should be provided.
Last edited by Masterkent on Tue Dec 13, 2016 5:39 pm, edited 1 time in total.
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: I need a custom Trigger!

Post by Krull0r »

How the hell do you know all this stuff? :D


Okay. anyway :) it works for my uses and since my project is always based on the latest 227j beta version everything should be finde for now :)
Image
Post Reply

Return to “UScript Board”