Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: a simple question  (Read 4757 times)

0 Members and 1 Guest are viewing this topic.

Finestre

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
a simple question
« on: September 30, 2011, 08:26:51 PM »

Hello to all, i do apologise for my question but i am stuck in it , i just want to move an object by keyboard arrows to the left and right. i have read other posts in the forum but couldnt understand those.just tell me if how i connect the script to the object. thanks alot my friends.
Logged

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: a simple question
« Reply #1 on: October 01, 2011, 08:24:20 AM »

y can look here for the moment http://forum.dead-code.org/index.php?topic=4908.0

or seach in the forum "keyboard moving" or similar.   :)
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

Finestre

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
Re: a simple question
« Reply #2 on: October 01, 2011, 09:36:20 AM »

Hello Keybone, you know i am really new to wme, i really dont know how to place my graphic element and its script to the correct place in the projectman explorer, i want a 2d square be moved by keyboard to left and right, what kind of object it is? an entity? a sprite? after that script should be connected to which object? content of script is what? Great thanks, this project start my wme life.
Logged

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: a simple question
« Reply #3 on: October 01, 2011, 01:07:57 PM »

use guide of wintermute and try done the tutorial for learn the base of the program.  :)

if no is impossible if y dont know nothing of the program ;)
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

Finestre

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
Re: a simple question
« Reply #4 on: October 01, 2011, 01:31:53 PM »

Hello Keybone and thanks for all your helps, let me tell you , i am confused to applying my subjects in wme, i have got 2d sqaure and your script prepared , they are all in the scene part,fully connected but square doesnt moves, it reflects an error like this mio amico :
4:01:40 PM:  Engine initialized in 26 ms
4:01:40 PM: 
4:01:40 PM:  Error opening file 'actors\molly\molly.actor'
4:01:40 PM:  CAdActor::LoadFile failed for file 'actors\molly\molly.actor'
4:01:40 PM:  Compiling script 'scenes\Room\scr\cube.script'...
4:01:40 PM:    Error@line 7: Variable 'VK_RIGHT' is referenced but not defined
4:01:40 PM:  Compiling script 'scenes\Room\scr\cube.script'...
4:01:40 PM:    Error@line 13: Variable 'VK_LEFT' is referenced but not defined
4:01:40 PM:  Runtime error. Script 'scenes\Room\scr\scene_init.script', line 5
4:01:40 PM:    Call to undefined method 'SkipTo'. Ignored.
Logged

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: a simple question
« Reply #5 on: October 01, 2011, 04:38:57 PM »

y have a problem with the actor and cant load it..in game.inc need to be a actor if no when load the game can to be any error..check if the molly actor work..if no copy the actors from directory of the turorial in wintermute install in your project

for cube.script y have a error.check the script
check your directory keys.inc for see y have the var VK_LEFT       = 37; and right...

for SkipTo dont know..post script if y can.
cya
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Re: a simple question
« Reply #6 on: October 03, 2011, 03:34:11 PM »

Hello

I have a couple of ideas

The first is the way that Wintermute works.  When the software is loaded a number of game scripts are running, these scripts amongst other things set up the game enironment and run the main game loop, they also provide core game elements in terms of the access to the systems menu, control the appearance of the inventory, bring up the right click menu and move the main object.

The two scripts are game.script and game_loop.script

One of the nice things about WME is that you can amend these scripts but you run the risk of stuffing things up big time if you get it wrong.

By default game.script expects molly as the main object so if you remove her from your system you have to alter game.script otherwise you will get the error message

In addtion to the main game/game_loop scripts wme runs a script for every scene that you create, these scene_init scripts also call for Molly aka actor.  So if you are going to take molly out of things there is a little bit of work to do.  My advice to you if you are just starting is to make make molly non active you can do this with a line of code

actor.Active = False.

regarding the problem with the key board  the keyboard character constants are supplied in a file call keys.inc
If you wish to use them in any script you need  the line

#include "scripts\keys.inc"
at the tope of your script, below the #include "scripts\base.inc" line.
In respect of you 2d square. I would make it a scene object.
I would have the controlling code in the scene_init file in a loop, which is only exited when you exit the scene.  I am not sure if attaching a script to the object will do anything




 
Logged
 

Page created in 0.042 seconds with 20 queries.