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

Author Topic: [Resolved] Positing char in virtual stage  (Read 1224 times)

satamail

  • General Accounts
  • *
  • Posts: 24
    • View Profile
[Resolved] Positing char in virtual stage
« on: Aug 30, 12, 09:30:11 AM »

Hi all.
I have a problem. I create virtual stage and create char in it, but it isn't moved by vertical. May be is some other way to view only face in VS

var charInVS = CopyCharacterIntoVirtualStage(GetAccountID(), stageName)

charInVS["Behave"] = "setposition (0,0,0)"
« Last Edit: Sep 26, 12, 09:46:20 AM by HE-Cooper »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Positing char in virtual stage
« Reply #1 on: Aug 31, 12, 07:15:49 AM »

Try the SetPosition() function on the hbnode and use a negative Y value.  That will lower them vertically.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

satamail

  • General Accounts
  • *
  • Posts: 24
    • View Profile
Re: Positing char in virtual stage
« Reply #2 on: Aug 31, 12, 01:19:35 PM »

Thanks, but
Code: [Select]
charInVS["Beh ave"] = "setposition (0,0,0)"isn't the same?
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Positing char in virtual stage
« Reply #3 on: Aug 31, 12, 03:16:13 PM »

I never use the behave version, so perhaps, but it would still need a negative number for Y.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

satamail

  • General Accounts
  • *
  • Posts: 24
    • View Profile
Re: Positing char in virtual stage
« Reply #4 on: Sep 04, 12, 03:01:40 AM »

If you mean setNodePosition it isn't work, too
Logged

PN-Dwight

  • General Accounts
  • *
  • Posts: 465
    • View Profile
    • Pirates' Nest
Re: Positing char in virtual stage
« Reply #5 on: Sep 04, 12, 03:24:08 AM »

A short notice here about the ["Behave"], as we were struggling with this to:

This is taken directly from our PN_CharacterSelectionSystem script:

Code: (hsl) [Select]
    when $CHARACTERSELECTIONSYSTEM._playerFaction
      is MARINE
        character["Behave"] = "setposition 20,0,0"
      .
      is PIRATE
        character["Behave"] = "setposition -0.3950137,-0.03993881,0.996787"
      .
    .
    character["Behave"] = "setrotation (0.0, 45.0, 0.0)"

Note that no ( ) were used on the setposition, but we did have to use them on the rotation to make it work.
« Last Edit: Sep 04, 12, 03:38:50 AM by PN-Dwight »
Logged

satamail

  • General Accounts
  • *
  • Posts: 24
    • View Profile
Re: Positing char in virtual stage
« Reply #6 on: Sep 04, 12, 08:50:54 AM »

Thanks., but it work with character in world. With character in virtual state it isn't work. May be it is some way to positing camera in virtual stage, insted player?
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Positing char in virtual stage
« Reply #7 on: Sep 04, 12, 04:49:57 PM »

When you posted
Code: (hsl) [Select]
var charInVS = CopyCharacterIntoVirtualStage(GetAccountID(), stageName)
charInVS["Behave"] = "setposition (0,0,0)"

is that all of the code you used, or were there other lines?

If that is all, then you probably will be helped by the additional lines shown the second code example here:
http://hewiki.heroengine.com/wiki/Virtual_Stage#Examples

Specifically, use the lines
Code: (hsl) [Select]
StageAutoZoom(stageName)
StageSetAutoCenterOnObjects(stageName, true)
to set up the stage.

Then, when the character is put on that stage, they are already positioned at (0,0,0) by default, and the above lines will have the camera focused on them. After that, you can adjust the position.

Our own code uses something like this for positioning the character:
Code: (hsl) [Select]
  var charNode = CreateCharacterInVirtualStage(charType, stageName)
  //Adjust position:
  if charNode != None
    pos as Vector3 = charNode["Position"]
    pos.x -= 0.01
    pos.y -= 0.10
    //pos.z -= 0.011
    charNode["Position"] = pos
  .

That shows using CreateCharacterInVirtualStage(), but CopyCharacterIntoVirtualStage() wil work the same way.  For you, you would only need to change the Y of the position to a lower number to lower the character.
« Last Edit: Sep 04, 12, 04:52:03 PM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

satamail

  • General Accounts
  • *
  • Posts: 24
    • View Profile
Re: Positing char in virtual stage
« Reply #8 on: Sep 06, 12, 08:42:16 AM »

Other lines is exist. I didn't write it because thing that they not so important. Thanks my problem is solved.
Logged