Quantcast
Channel: General - Epic Developer Community Forums
Viewing all articles
Browse latest Browse all 9618

Issue with documentation tutorial: "Create your own NPC Medic"

$
0
0

For the “Create your own NPC Medic” tutorial on the documention, in the queue.verse code that the documentation provides, there is a script error. Line 5 for “(t:type)”.

See error from UEFN: queue.verse(5,14, 5,22) : Script error 3502: Can’t access a function from a preceding type.

Any potential solutions?

Link: Create your own NPC Medic

Full code below:

list(t:type) := class:
    Data:t
    Next:?list(t)

queue<public>(t:type) := class<internal>:
    Elements<internal>:?list(t) = false
    Size<public>:int = 0

    Enqueue<public>(NewElement:t):queue(t) =
        queue(t):
            Elements := option:
                list(t):
                    Data := NewElement
                    Next := Elements
            Size := Size + 1

    Dequeue<public>()<decides><transacts>:tuple(queue(t), t) =
        List := Elements?
        (queue(t){Elements := List.Next, Size := Size - 1}, List.Data)

    Front<public>()<decides><transacts>:t = Elements?.Data

CreateQueue<public><constructor>(InData:t where t:type) := queue(t):
    Elements := option:
        list(t):
            Data := InData
            Next := false
    Size := 1

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 9618

Trending Articles