Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (3run, AndrewAMD), 667 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How to add an action to an object? #426329
07/21/13 07:11
07/21/13 07:11
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
I am trying to add an action to a door in my 3D environment. When I import a pre-made model character into my WED level, and specify under Map Properties what SED file to connect the WED file to, I am able to specify what action to apply to the model character under a Behaviour tab that shows up. The tabs that show up for this model character are: Properties, Behaviour, Position, Object.

However, when I highlight an object like a door in my 3D environment, the Behaviour tab does not show up that allows me to apply an action. Only these tabs appear: Properties, Position, Object, <Blocks>, which do not seem to give me the option of assigning an Action to the door object.

Does anyone know how to bring up an option of assigning an Action to an object like a door in the 3D environment?

Last edited by Ruben; 07/21/13 07:21.
Re: How to add an action to an object? [Re: Ruben] #426330
07/21/13 09:15
07/21/13 09:15
Joined: Jul 2004
Posts: 785
Serbia
Iglarion Offline
User
Iglarion  Offline
User

Joined: Jul 2004
Posts: 785
Serbia
You're talking about a group of wed blocks, right?
First you must convert this door into map entity, then you will able attach action to this object.
One of way to do this - put this door in one empty level, build, find in your game folder this new wmb file, inport in your level as map entity and give him action.

Re: How to add an action to an object? [Re: Iglarion] #426337
07/21/13 12:48
07/21/13 12:48
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Iglarion's tip is of course right. But I don't know if this got totally clear: You can only assign actions to entities.


Always learn from history, to be sure you make the same mistakes again...
Re: How to add an action to an object? [Re: Uhrwerk] #426349
07/21/13 17:14
07/21/13 17:14

M
Malice
Unregistered
Malice
Unregistered
M



When making a door as a map entity remember that vec(0,0,0) in the world will need the be the door hinge side, or the origin like point 0,0,0 in med. Also for lighting reason you should use a model mdl not a map_ent (or has this change?)

Re: How to add an action to an object? [Re: ] #426357
07/21/13 20:46
07/21/13 20:46
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
@ Iglarion: Thank you for your advice. I was able to import my door in my WED level as a Map Entity. I have only one problem though, the door entity is not carrying its original texture into the WED level. When I try to compile, I get this message asking me to apply the default texture to entities not given a texture. I click OK, and compile. However when I do, the door ends up with the default texture, which is a gray brick wall texture, and not its original wooden texture. I try to apply a new texture to the door entity after its imported into the WED level, but the option to Apply Texture is grayed out, not allowing me to do it. Do you know how I can keep the door entity's original texture, and not have it use the default texture?

@ Malice: Thank you for your advice as well. Are you referring to the World Position for the door entity in its own WED file, for vec(0,0,0)? I imported my door entity into my WED level, however, it seems off center. I place the door entity at a certain location in my WED level. However when I compile the WED file and run the SED file, it is off from where I placed it. I have to move it further than where I want it, in order to have it centered where I want it. Does this have to do with making sure the door is at vec(0,0,0) in its own WED file?

I have another issue. I am trying to make it so that when my player walks into this door, the Lite-C program will initiate a function that will load a different room called StrongholdArena.wmb. I applied an action to the door using EVENT_IMPACT, to load another file upon impact. When I run my SED file, and have the player run into the door, I get this error message box saying I made an invalid call to to_arena_door_f(). Here is my code so far:

Code:
function to_arena_door_f()
{
  if(event_type == EVENT_IMPACT)
  {
    level_load ("StrongholdArena.wmb");  
  }
}

action to_arena_door_a()
{
  my.emask |= ENABLE_IMPACT;
  my.event = to_arena_door_f;
}


I applied the action to_arena_door_a() to the door, and I get this invalid call to to_arena_door_f() when I run my player into the door. Does anyone know why I am getting this error?

Last edited by Ruben; 07/21/13 21:00.
Re: How to add an action to an object? [Re: Ruben] #426359
07/21/13 21:00
07/21/13 21:00

M
Malice
Unregistered
Malice
Unregistered
M



Make the door in a "new" wed file out of a shaped block(cube) into the size you need. The hinge side of the block should be on the world point 0,0,0 and that point should be center of the hinge side. So the z line runs up the hinge edge of the door. Click the texture tab in the panels - one the default wed - (if the block is selected) click the texture to apply and select apply. -- or open texture manager to add a new wad.. Texture not in a wad ??? - let me know-

Save wed file as doorx1 .Compile door block as "simple level" - go to original wed file. select object object -> add map entity

Re: How to add an action to an object? [Re: ] #426360
07/21/13 21:03
07/21/13 21:03

M
Malice
Unregistered
Malice
Unregistered
M



Not the best way to do a level load -- but wait(1 to 5) before level_load() and call out to do it.

Code:
void load_me()
{
  level_load(here);
}

void event()
{
  if(event_type == EVENT_IMPACT)
   {
     wait(5);
     load_me();
    }
}



If that didn't work then I don't know.. Maybe the function name?

Last edited by Malice; 07/21/13 21:09.
Re: How to add an action to an object? [Re: ] #426361
07/21/13 21:09
07/21/13 21:09
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Originally Posted By: Malice
Make the door in a "new" wed file out of a shaped block(cube) into the size you need. The hinge side of the block should be on the world point 0,0,0 and that point should be center of the hinge side. So the z line runs up the hinge edge of the door. Click the texture tab in the panels - one the default wed - (if the block is selected) click the texture to apply and select apply. -- or open texture manager to add a new wad.. Texture not in a wad ??? - let me know-

Save wed file as doorx1 .Compile door block as "simple level" - go to original wed file. select object object -> add map entity

I notice that there are no textures available to apply to the door in its own WED file, other than the default texture. Do you know how to bring up the other textures that are available?

Re: How to add an action to an object? [Re: Ruben] #426362
07/21/13 21:10
07/21/13 21:10

M
Malice
Unregistered
Malice
Unregistered
M



Yes right-click the default texture then select texture manager.. Add WAD. Our textures are packed into WAD file.

Last edited by Malice; 07/21/13 21:11.
Re: How to add an action to an object? [Re: ] #426363
07/21/13 21:12
07/21/13 21:12
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Originally Posted By: Malice
Not the best way to do a level load -- but wait(1 to 5) before level_load() and call out to do it.

Code:
void load_me()
{
  level_load(here);
}

void event()
{
  if(event_type == EVENT_IMPACT)
   {
     wait(5);
     load_me();
    }
}



If that didn't work then I don't know.. Maybe the function name?

It worked! Thank you so much! This is a big fix for my video game. :-)

Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1