HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Taschenmogul

Pages: [1]
1
GUI Creation / [Resolved] How to use GUIGraph?
« on: Jun 09, 11, 07:37:50 PM »
So I looked at the GUI controls and came to this little function.
Description says it would draw a graph, and it seems to be intuitive enough - at least at first glance.

I quickly realized that description for this was lacking some most basic details.
Like for example, it is said to use "SetGUIGraphData" for setting... well the GUIGraph data.
Fair enough, but it lists "style as Enum GraphStyle" as an argument for this function, explained as "An enumerated value of type GraphStyle".

Here is what is written in the wiki (http://wiki.heroengine.com/wiki/SetGUIGraphData):
Code: [Select]
SetGUIGraphData(graph as NodeRef of Class GUIGraph, useRange as Boolean, minRange as Float, maxRange as Float, \\
   data as List of Vector3, style as Enum GraphStyle)

Now I canīt find anything about this type "GraphStyle", it doesnīt seem to exist.
At least not in the wiki, not in the forum, and the HeroScript Editor also doesnīt give any tips.
Have I overlooked something or are we really supposed to guess what values this "GraphStyle" allows?
Well, at least thatīs what I did, and entering the word "line" for this resulted in the script being compiled, so "line" seems to be a valid GraphStyle.

Other question - am I right that minRange and maxRange mean the minimum and maximum value that any coordinate of any vector in the needed Vector3-list has?
So that when you would draw a linear curve from X0,Y0 to X60,Y60 you would enter "minRange = 0" and "maxRange = 60"?

Also, does the "useRange" argument work at all?
Setting it to "false" at least doesnīt free you from the necessity to declare min and max Range.

So much for the gripe.
Now that I believeto have the arguments right, I still donīt really know how to implement a GUIGraph.
Iīve now done it like that (other code like "G1Graph.name" omitted for this example):

Code: [Select]
G1Graph as NodeRef of Class GUIGraph = createNodeFromPrototype("_window")
SetGUIGraphData(G1Graph, true, 0, 60, VecList, line)

Where "VecList" is defined as:
Code: [Select]
VecList as List of Vector3
So first question here - what prototype should I use? Is "_window" correct?
And - how do I apply this in general?
Iīll post my code below; I tried out the GUI Tutorial and linked it to a trigger.
All worked fine, a window would appear with text in it.
As soon as I add the GUIGraph though, the text disappears and the window stays empty, in addition though a red square is generated that doesnīt match the GUI windows position at all, even though they both should be positioned equally.
Moving this red square (the size doesnīt change whatever I put for G1Graph.size.x or .y) also moves the window, so they both seem to be connected.
What I tried to do in this example was to generate random numbers from 0 to 60 (coupled to the system.time.seconds) that are then plotted to a graph with x ranging from 0 to 60, based on a loop that fills the list of Vector3.
The code below only shows one "state" of what I have tried; the GUIGraph doesnīt seem to work at all the way I tried to implement it.

So, please give me some advice on how to use the GUIGraph!
Oh, and by the way, how do I render a simple text within the clientarea?
I would guess that you also needed to make a GUI for that, however I donīt want any window shown, just the text. Would I have to use layers, setting the windows layer to invisible, only showing the text on a different layer?
Cause when setting the basic GUIControl window to invisible, the text consequently disappears too.


So, here is my code:

Code: [Select]
function MogTrigg1_TriggerEnter( triggeredBy as NodeRef)

VecList as List of Vector3

loop i from 0 to 30
       Sec as Integer = SYSTEM.TIME.NOW.second   
        F as Float = GenRand()
        F2 as Integer = round(F * Sec)
       
       
       Tpvec as Vector3
       Tpvec.x = (i * 2)
       Tpvec.y = F2
       Tpvec.z = 0
       
       add back Tpvec to VecList
       .
               
     
  G1 as NodeRef of Class GUIControl = createNodeFromPrototype("_window")
  G1.build = true
  G1.name = "G1"
  G1.size.x = 300
  G1.size.y = 60
  G1.opacity = 0.5
   
    Screen as Vector3 = getViewPortSize()
    G1.position.x = (Screen.x - G1.size.x) / 2
    G1.position.y = (Screen.y - G1.size.y) / 2
   
    GTitel as NodeRef of Class GUILabel = findGUIControlByName(G1, "titlebar.title")
    GTitel.text = "GUI-Titel"
    GTitel.justification = CENTER
     
    G1Graph as NodeRef of Class GUIGraph = createNodeFromPrototype("_window")
    G1Graph.name = "Graph"
    SetGUIGraphData(G1Graph, true, 0, 60, VecList, line)
    G1Graph.size.x = 300
    G1Graph.size.y = 60
    G1Graph.position.x = (Screen.x - G1.size.x) / 2
    G1Graph.position.y = (Screen.y - G1.size.y) / 2
   
   
    G1Label as NodeRef of Class GUILabel = createNodeFromPrototype("_label")
    G1Label.name = "GUI-Label"
    G1Label.text = "{f:#1,1,0,1}Trigger triggered{/}"
    G1Label.autoSetHeight = true
    G1Label.opacity = 1
 
   
    clientArea as NodeRef of Class GUIControl = G1.getClientarea()
    add back G1Label to clientArea.children
    G1Label.dockMode = BOTTOM
   
    G1Label.build = true   
   
    add back G1Graph to clientArea.children
    G1Graph.dockMode = BOTTOM
    G1Graph.build = true
   
    .


Thanks in advance!


PS:
Forget the question about making simple text without a box; found out how that works, donīt know why it didnīt before...

2
Design & World Building / [Resolved] Maximum extent of an area?
« on: Jun 04, 11, 07:25:01 PM »
Hi there!

Iīve been looking for some answers to these questions but have found nothing regarding them:

1. How big can an area be? Iīm not talking about the heightmap, Iīm talking about the "logical" extent of an area. I would guess that itīs something like "till you reach the max value in either direction"; is it like that? And if it is, what is this max value, how are coordinates stored? Floatingpoint, it seems to be, but how many bits?

2. Is it necessary for movement to have a groundplane/heightmap somewhere under your feet?
Iīve noticed that even when flying/falling you stop at the edge of the heightmap, in midair.
On the other hand while out of character using the fly mode you can move freely, so I guess it can be scripted so that you donīt need a heightmap for your character to fly around.
Is this correct?

3. Is it possible to seamlessly link areas in 3 dimensions? So that an area is seamlessly linked to other areas on all 6 sides?

The reason Iīm asking this is because we wanna add spaceflight, and even though I have seen and read that at least some of the needed/wanted functionality is there or can be scrippted, abovewritten questions are a little more specific than "can we navigate in three dimensions?".

So, if someone can shed a little light on this, please do!


EDIT PS

No answers as of now, but Iīll add another question nonetheless:

4. Is there any way for characters to interact across the boundaries of seamlessly (2.0) connected areas?
Weīve noticed that characters canīt see each other even when standing in front of each other, if one of them is in another area.
Targeting is also interupted when one character moves into another area.
So, say one character chases another and the former flees across the border to a seamlessly connected area, then the latter both looses target and loses sight of the fleeing character.
In the same way, say one character stands not far away from the border, he couldnīt see a character coming from the other area and could practically be ambushed without a chance to see whatīs coming.

Is there a way to resolve this issue or a reasonable workaround?


PPS: *BUMP* Nobody? Anybody, any tip? Come on people! ;-)

3
Art & Art Pipeline / [Resolved] Strange shading of polygons
« on: May 24, 11, 04:17:05 PM »
Hi there!

Iīve noticed this problem a while ago and tried different things out to solve it - while working with testtiles for tilesets I got this really strange shading that, as I saw later, was connected to the individual triangles of the tiles.
Iīve posted a picture showing the problem below.

So I looked around and found no reference to this problem, neither here in the forum nor on the wiki, nor via google.
Seemed like nobody else had this problem.
Now I have a bit of experience with 3d modelling and rendering but have not had any concrete experience with making models for games.
Seems to me like itīs kind of a phong shading issue and Iīve mainly worked with SDS and Nurbs in the past so that I havenīt got that much experience with phong shading on triangulated meshes.
So perhaps itīs a common problem that everybody knows to solve (or to accept) and thatīs why I didnīt find any mention of it?

On the other hand I just canīt imagine that others could consider that shading acceptable, so I guess there has to be a solution to it.
Now after some experiments I have found something like a solution but Iīm unsure if that can really be it.

Now, below is a (modified) screenshot from the engine.



Lefthand you see two simple groups of 2x4 assets with visible edges (colorized to be better recognizable), on the right we see those models without edgelighting.
The group in the top row is made of the original model and especially on the right you can see how bad shading errors get.
Below you see a group of modified models, and as you can see the shading errors are gone.

What I have done is the following, and you can see it on the left where the arrows are hinting at the respective polygons - I simply have flipped the internal edges by 90 degrees. And shading errors are gone.
So Iīm uncertain.
Do we really have to manually define internal edges of wouldbe quads, not being able to simply click "triangulate"?
Can this really be the solution?
Or does someone have a better one and could perhaps hint me in the right direction with some enlightening link?

Please, help me out of my not-getting-it! ;-)

Pages: [1]