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

Author Topic: [Solved]Problem with Spec Oracle editing  (Read 1555 times)

Akezhar

  • General Accounts
  • *
  • Posts: 12
    • View Profile
[Solved]Problem with Spec Oracle editing
« on: Sep 27, 12, 04:14:05 PM »

Hi again, after i managed to put the entry in the hotspot i'm against another problem that i can't figure out,
when i try to add a new entry in the specoracle editor i get this error "the specoracle does not have any base classes!".
Anyone knows how to solve this?
I've checked my scripts against those in the hjref and everything seems ok but obviously there is something that's not :).
« Last Edit: Sep 28, 12, 02:18:37 PM by Akezhar »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Problem with Spec Oracle editing
« Reply #1 on: Sep 27, 12, 04:43:00 PM »

You should have a server class for your spec oracle, and in that class script you need to define "method GetValidBaseClasses() as List of String" which must return a list of the names of classes that can be used as base classes for the specs.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Akezhar

  • General Accounts
  • *
  • Posts: 12
    • View Profile
Re: Problem with Spec Oracle editing
« Reply #2 on: Sep 27, 12, 04:49:07 PM »

i have this in my SpecOracleClassMethods script
Code: [Select]
method getValidBaseClasses() as List of String
// return a list of classes that prototypes for the spec can be created from
//
//
  valid as List of String
  add back "CharacterSlotsSpec" to valid
  return valid
.

where CharacterSlotsSpec is the newly created class for the purpose of the exercise.
that's the reason i don't know what to do.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Problem with Spec Oracle editing
« Reply #3 on: Sep 27, 12, 05:09:44 PM »

Searching for that error message shows it being issued in client script _GUISpecOracleSpecSelectorClassMethods method _onButtonMouseClick().  I would suggest tracing back from there to see where it goes wrong.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Akezhar

  • General Accounts
  • *
  • Posts: 12
    • View Profile
Re: Problem with Spec Oracle editing
« Reply #4 on: Sep 27, 12, 05:30:20 PM »

thanks for your help, i'll try to find it out.
Logged

Akezhar

  • General Accounts
  • *
  • Posts: 12
    • View Profile
Re: Problem with Spec Oracle editing
« Reply #5 on: Sep 28, 12, 01:37:48 PM »

I've got it working, i missed the prototype for the specoracle on the server.

going through the tutorial again i have another question:
how do i do this part?
Quote
Adding Header Fields to your Spec List

To add a column to your spec listings, you can perform the following bit of HSL code once on the server:
var oracle = GetPrototype("YourSpecOracle")
where oracle is kindof YourSpecOracle
  oracle.AddCollectionHeader("<fieldname>","<displayname>",<true|false>)
.
<fieldname> the name of the you want as a header (must be a valid field name on your spec class)
<displayname> the display name of that field you want (can be any valid string)
<true|false> True will add the header to the end of the list of headers, false will add it to the beginning

EDIT: Nevermind I've found the creating server scripts tutorial on the wiki.
« Last Edit: Sep 28, 12, 01:55:24 PM by Akezhar »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Problem with Spec Oracle editing
« Reply #6 on: Sep 28, 12, 01:56:50 PM »

That is showing server code to run, so the easiest way to make that accessible is to put that code in a server chat command and run from the Chat panel.  If you haven't made a chat command, yet, look over the Creating Server Scripts tutorial.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Akezhar

  • General Accounts
  • *
  • Posts: 12
    • View Profile
Re: [Solved]Problem with Spec Oracle editing
« Reply #7 on: Sep 28, 12, 02:19:59 PM »

Yeah i've figured that out ;) thank you very much for your help Scott very helpful.
Logged

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Problem with Spec Oracle editing
« Reply #8 on: Sep 28, 12, 05:31:10 PM »


Quote
Adding Header Fields to your Spec List

To add a column to your spec listings, you can perform the following bit of HSL code once on the server:
var oracle = GetPrototype("YourSpecOracle")
where oracle is kindof YourSpecOracle
  oracle.AddCollectionHeader("<fieldname>","<displayname>",<true|false>)
.
<fieldname> the name of the you want as a header (must be a valid field name on your spec class)
<displayname> the display name of that field you want (can be any valid string)
<true|false> True will add the header to the end of the list of headers, false will add it to the beginning



You can also use this : https://community.heroengine.com/forums/index.php/topic,1180.0.html
Logged

Akezhar

  • General Accounts
  • *
  • Posts: 12
    • View Profile
Re: [Solved]Problem with Spec Oracle editing
« Reply #9 on: Sep 28, 12, 05:39:40 PM »

nice one thanks for pointing that out.
Logged