Questions about Canvas
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Questions about Canvas
I've some questions about canvas:
1. Why can I use "PostRender()" function on weapons(when active on player), to spawn multiple chairs with the "DrawActor()" function, and not to spawn multiple candles?
2. Who calls "RenderOverlays()" function? I saw that function overriden into "GuidedWarshell" class, and so I though that to call it on an actor, I just needed to make it my view target, but it is not called when an actor is my view target.
1. Why can I use "PostRender()" function on weapons(when active on player), to spawn multiple chairs with the "DrawActor()" function, and not to spawn multiple candles?
2. Who calls "RenderOverlays()" function? I saw that function overriden into "GuidedWarshell" class, and so I though that to call it on an actor, I just needed to make it my view target, but it is not called when an actor is my view target.
"Your stuff is known to be buggy and unfinished/not properly tested"
- Shadow
- Masterful
- Posts: 743
- Joined: Tue Jan 29, 2008 12:00 am
- Personal rank: Mad Carpenter
- Location: Germany
- Contact:
Re: Questions about Canvas
2. renderoverlays is called by the pawn that owns that weapon, if that weapon is currently the active weapon - renderoverlays on any actor is called automatically if it's the current viewtarget of the playerpawn
although I don't understand your first question..
Code: Select all
simulated event RenderOverlays( canvas Canvas )
{
if ( Weapon != None )
Weapon.RenderOverlays(Canvas);
}
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Questions about Canvas
I tried using "DrawText()" function, it worked on "PostRender()" function(the overrided one from a weapon), but it didn't work with inside "RenderOverlays()" function from a whatever class. I tried using the DrawText() inside RenderOverlays() into a Trigger object, and when I entered the command "cheatview Trigger", when that trigger became my ViewTarget, no text was shown, even if I wrote a call to DrawText().Shadow wrote:2. renderoverlays is called by the pawn that owns that weapon, if that weapon is currently the active weapon - renderoverlays on any actor is called automatically if it's the current viewtarget of the playerpawn
although I don't understand your first question..Code: Select all
simulated event RenderOverlays( canvas Canvas ) { if ( Weapon != None ) Weapon.RenderOverlays(Canvas); }
For the chairs/candles case: Inside a weapon class, I tried calling the "PostRender()" function and make it Draw a Chair on the Canvas, with the "DrawActor()" function. It worked, it spawned a chair every frame, but only the last one was visible in game, the other ones were just invisible, but collideable and destructable. I tried changing the actor, from Chair to Candle, and the game crashed. It doesn't happen just with candles.
"Your stuff is known to be buggy and unfinished/not properly tested"
- sektor2111
- Godlike
- Posts: 6403
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Questions about Canvas
I'm really happy because I never intend to try what you do blindly.
First of all, spawning an actor in render !!?? - This won't very occur in servers, only if client calls that in certain cases but... anyway...
Second: Change you glasses (or buy some from a good shop) and see default-properties of candle. Good luck with spawning candles...
The third - you said: Crash ? I would look over logs just by curiosity.
First of all, spawning an actor in render !!?? - This won't very occur in servers, only if client calls that in certain cases but... anyway...
Second: Change you glasses (or buy some from a good shop) and see default-properties of candle. Good luck with spawning candles...
The third - you said: Crash ? I would look over logs just by curiosity.
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Questions about Canvas
So you meant, that it is because Candle class has these 2 settings:sektor2111 wrote:I'm really happy because I never intend to try what you do blindly.
First of all, spawning an actor in render !!?? - This won't very occur in servers, only if client calls that in certain cases but... anyway...
Second: Change you glasses (or buy some from a good shop) and see default-properties of candle. Good luck with spawning candles...
The third - you said: Crash ? I would look over logs just by curiosity.
bCollideActors=True
bCollideWorld=True
(That doesn't even work in game, but well...)
?
Well, that's weird that Chair class has bCollideActors and bCollideWorld to False tho... o.o
Anyway Thank you for the answer
"Your stuff is known to be buggy and unfinished/not properly tested"
- sektor2111
- Godlike
- Posts: 6403
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Questions about Canvas
Nope, you did not even read latest posts with iterator deletion, so you don't seems to understand that a PATHNODE, CANDLE OR ANY bStatic or bNoDelete WON'T SPAWN NORMALLY EVER without hacks.
A friendly advice:
Do some mutator in DM for whatever accelerating combat purposes. In random moments toy with these values at pawns and see what you get before to speak more bad presumptions if their name is not enough self explanatory.
Yes... you don't understand these, and they ARE VERY WORKING - and they are pretty Important at a moment or Absolutely important when we speak about pawns as actors linked with these.PrinceOfFunky wrote: So you meant, that it is because Candle class has these 2 settings:
bCollideActors=True
bCollideWorld=True
(That doesn't even work in game, but well...)
A friendly advice:
Do some mutator in DM for whatever accelerating combat purposes. In random moments toy with these values at pawns and see what you get before to speak more bad presumptions if their name is not enough self explanatory.
Re: Questions about Canvas
I'm still not sure what you want to achieve: either spawning something in the map? Then it will be drawn by client automatically. Or do you want to change what is shown on clients screen? Then you should have a look at the HUD classes.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
- sektor2111
- Godlike
- Posts: 6403
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Questions about Canvas
Exactly this is my out of understanding point - Canvas + Spawning Candles which won't spawn, and Canvas runs mainly in player after all...Barbie wrote:I'm still not sure what you want to achieve: either spawning something in the map? Then it will be drawn by client automatically. Or do you want to change what is shown on clients screen? Then you should have a look at the HUD classes.
Re: Questions about Canvas
For further notice, I'd recommend that you check the wiki at http://wiki.beyondunreal.com/ before asking questions about things that has already been documented.
RenderOverlays() is exactly what it says, it's used to draw additional textures and stuff when the weapon is selected.
Canvas is simple, DrawActor() for example is used to draw actors on the Player's screen, like the weapon.
If you want to print text on the clients HUD you'd probably want a HUD mutator (Check wiki).
I'd also suggest you to do some research on how client/server roles work, and why you shouldn't blindly spawn crap on the client.
EDIT:
You don't Spawn anything using the DrawActor() function.
Read this:
http://wiki.beyondunreal.com/What_happe ... awn_checks
RenderOverlays() is exactly what it says, it's used to draw additional textures and stuff when the weapon is selected.
Canvas is simple, DrawActor() for example is used to draw actors on the Player's screen, like the weapon.
If you want to print text on the clients HUD you'd probably want a HUD mutator (Check wiki).
I'd also suggest you to do some research on how client/server roles work, and why you shouldn't blindly spawn crap on the client.
EDIT:
You don't Spawn anything using the DrawActor() function.
Read this:
http://wiki.beyondunreal.com/What_happe ... awn_checks
-
- Godlike
- Posts: 3774
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: Questions about Canvas
Personally I think canvas and HUD is only slightly easier to fully understand than replication. Don't worry if it takes a while to make sense of things.
So long, and thanks for all the fish
Re: Questions about Canvas
Truth is that, HUD and Canvas in UE1 is very messy and inefficient.
Obviously a Canvas can only exist on a client, which in turn is co-operating with the viewport.
The Canvas object is not stored in a global variable logically, but sent as a parameter to a function such as PostRender() which has to be called every tick because everything gets flushed right at the beginning of the tick.
Looking at Epic's HUD code might be confusing and not really helpful at first because it's alot to wrap your head around.
For example the default HUD mutator registration method is broken for network play.
Obviously a Canvas can only exist on a client, which in turn is co-operating with the viewport.
The Canvas object is not stored in a global variable logically, but sent as a parameter to a function such as PostRender() which has to be called every tick because everything gets flushed right at the beginning of the tick.
Looking at Epic's HUD code might be confusing and not really helpful at first because it's alot to wrap your head around.
For example the default HUD mutator registration method is broken for network play.
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Questions about Canvas
No, I wasn't interested.sektor2111 wrote:Nope, you did not even read latest posts with iterator deletion
I know it... but you said:sektor2111 wrote:so you don't seems to understand that a PATHNODE, CANDLE OR ANY bStatic or bNoDelete WON'T SPAWN NORMALLY EVER without hacks.
And so I though that the solution was directly written in the default properties of Candle calss.sektor2111 wrote:Change you glasses (or buy some from a good shop) and see default-properties of candle. Good luck with spawning candles...
I always check the wiki before to post here.Chris wrote:For further notice, I'd recommend that you check the wiki at http://wiki.beyondunreal.com/ before asking questions about things that has already been documented.
Well... ...actually the name "RenderOverlays" doesn't implicity say it all, but ok. XDChris wrote:RenderOverlays() is exactly what it says, it's used to draw additional textures and stuff when the weapon is selected.
I already did it and I didn't need an HUD mutator.Chris wrote:If you want to print text on the clients HUD you'd probably want a HUD mutator (Check wiki).
If I don't spawn the actor before to give it as parameter to the "DrawActor()" function, it gives me an error.Chris wrote:You don't Spawn anything using the DrawActor() function.
Already read it.Chris wrote:Read this:
http://wiki.beyondunreal.com/What_happe ... awn_checks
But I think there might be at least one Canvas variable somewhere.Chris wrote:The Canvas object is not stored in a global variable logically, but sent as a parameter to a function such as PostRender() which has to be called every tick because everything gets flushed right at the beginning of the tick.
Yeah, I mean, there are a lot of better solution than canvas, they could use, I guess.JackGriffin wrote:Personally I think canvas and HUD is only slightly easier to fully understand than replication. Don't worry if it takes a while to make sense of things.
Sorry for the long post.
"Your stuff is known to be buggy and unfinished/not properly tested"
Re: Questions about Canvas
"Render Overlays" What is hard to understand in that? Are you saying that it doesn't explain what "Rendering" and "Overlays" is? Well in that case you can walk that chain forever.PrinceOfFunky wrote:Well... ...actually the name "RenderOverlays" doesn't implicity say it all, but ok. XDChris wrote:RenderOverlays() is exactly what it says, it's used to draw additional textures and stuff when the weapon is selected.
If I don't spawn the actor before to give it as parameter to the "DrawActor()" function, it gives me an error.Chris wrote:You don't Spawn anything using the DrawActor() function.
But I think there might be at least one Canvas variable somewhere.Chris wrote:The Canvas object is not stored in a global variable logically, but sent as a parameter to a function such as PostRender() which has to be called every tick because everything gets flushed right at the beginning of the tick.
It doesn't seem like you understand what I'm saying. If you understand the mechanics of the Canvas, then you'd also understand why you wouldn't point a Canvas object to a global variable. It doesn't make sense unless you want to use its metrics functions only.
One thing I had in mind as an optimization to the Canvas would be to have elements, such as a text string wrapped in a "TextObject" and only have it updated when needed, where each one would have an FName ID so you could do something like "GetTextObject('Ammo').setText(100)" Same thing for non translucent/modulated textures (these would have to be updated each tick)
The design of UE1 wouldn't allow that but it's an idea.
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Questions about Canvas
I feel like I should be use to this UE1 ways... lolChris wrote:"Render Overlays" What is hard to understand in that? Are you saying that it doesn't explain what "Rendering" and "Overlays" is? Well in that case you can walk that chain forever.PrinceOfFunky wrote:Well... ...actually the name "RenderOverlays" doesn't implicity say it all, but ok. XDChris wrote:RenderOverlays() is exactly what it says, it's used to draw additional textures and stuff when the weapon is selected.
If I don't spawn the actor before to give it as parameter to the "DrawActor()" function, it gives me an error.Chris wrote:You don't Spawn anything using the DrawActor() function.
But I think there might be at least one Canvas variable somewhere.Chris wrote:The Canvas object is not stored in a global variable logically, but sent as a parameter to a function such as PostRender() which has to be called every tick because everything gets flushed right at the beginning of the tick.
It doesn't seem like you understand what I'm saying. If you understand the mechanics of the Canvas, then you'd also understand why you wouldn't point a Canvas object to a global variable. It doesn't make sense unless you want to use its metrics functions only.
One thing I had in mind as an optimization to the Canvas would be to have elements, such as a text string wrapped in a "TextObject" and only have it updated when needed, where each one would have an FName ID so you could do something like "GetTextObject('Ammo').setText(100)" Same thing for non translucent/modulated textures (these would have to be updated each tick)
The design of UE1 wouldn't allow that but it's an idea.
"Your stuff is known to be buggy and unfinished/not properly tested"