neues Object im spiel erstellen

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • neues Object im spiel erstellen

    Hallo WELT,
    1.Geht es das man in einem spiel ein völlig neues object erstellt und diesem befehle zuweist?
    sowas wie

    GML-Quellcode

    1. create_object_new(x,y,"name_obj"))
    2. create_event("name_obj",mouse_over)
    3. create_code("name_obj",mouse_over,"schow_message("hallo)")

    (also sowas in der art).
    2.wie heißen die einzelnen events für die verwendung?(keypress usw.)
    ich hoffe ihr versteht mich in etwa.
    mfg gamer_08

    edit:Lösung:
    damit die die danach suchen es schneller finden:

    GML-Quellcode

    1. object_add() //zum hinzufügen eines objectes
    2. object_delete(ind) //zum löschen
    3. object_event_add(ind,evtype,evnumb,codestr)//zum hinzufügen eines events+codes

    genaueres in dragoons post:

    Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von gamer_08 ()

  • nein,außer wenn du ein objeckt machst da durch Variablen aktionen ausführen soll z.b
    obj_bal:
    Creat Event=

    GML-Quellcode

    1. var global.aktio
    2. global.aktio=Move
    3. var global.move_x
    4. global.move_x=1
    5. global.move_y=1

    obj_bla1
    Step:

    GML-Quellcode

    1. if (aktio=move)
    2. {
    3. x=global.move_x
    4. y=global.move_y
    5. }

    So müsste das richtig sein :)
    MfG Henrik1235
    wupto.net/ Nicht meine Seite!
    We love Koalas.

    GM-D-Spam-o-Meter: 32%
  • Wie wärs mit einem Blick in die Hilfe?
    The following routines are useful for creating objects on the fly. As with all resource changing routines, be very careful that you don't create new objects all the time.

    object_add() Adds a new object. It returns the index of the object. You can now use this index in the routines above to set certain properties of the object and then you can use the index to create instances of the object.
    object_delete(ind) Deletes the object with the given index. Make sure no instances of the object exist in any of the rooms.
    object_event_add(ind,evtype,evnumb,codestr) To give the object a behavior we must define events for the object. You can only add code actions to events. You need to specify the object, the event type, the event number (use the constants that have been specified before for the event_perform() function). Finally you provide the code string that must be executed. You can add multiple code actions to each event.
    object_event_clear(ind,evtype,evnumb) You can use this function to clear all the actions for a particular event.

    Creating objects is in particular useful when you are designing scripts or action libraries. For example, an initialization script can create an object to display a text and another script can add such an object with a particular text. In this way you have a simple mechanism to display texts without the need to create objects using the standard interface.
    int (*x(*x(int))[5])(int*);
    Confused? Yes, it's C!
  • KLASSE DANACH HAB ICH GESUCHT 8o ,
    In der hilfe hab ichs net gefunden gehabt aber die findet bei mir irgendwie gar nix.
    Danke Dragoon [u]das problem ist gelöst![/u]
    mfg gamer_08

    edt:noch eine frage:wie heißen die einzelnen events? also für mouse over usw..

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von gamer_08 ()