|
2 registered members (3run, AndrewAMD),
667
guests, and 1
spider. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
User
|
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: Iglarion]
#426337
07/21/13 12:48
07/21/13 12:48
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
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
|
Malice
Unregistered
|
Malice
Unregistered
|
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
OP
User
|
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:
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
|
Malice
Unregistered
|
Malice
Unregistered
|
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
|
Malice
Unregistered
|
Malice
Unregistered
|
Not the best way to do a level load -- but wait(1 to 5) before level_load() and call out to do it.
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
OP
User
|
OP
User
Joined: Jun 2010
Posts: 590
California
|
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
|
Malice
Unregistered
|
Malice
Unregistered
|
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
OP
User
|
OP
User
Joined: Jun 2010
Posts: 590
California
|
Not the best way to do a level load -- but wait(1 to 5) before level_load() and call out to do it.
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. :-)
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|