Page 19 of 400

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 12:08 am
by Matlock19
Well I hate to say it, but it's still not working. I changed it to:

Code: Select all

    defineObject{
         name = "rusty_key",
         components = {
         {
           class = "Model",
           model = "assets/models/items/key_brass.fbx",
         },
         {
           class = "Item",
           uiName = "Rusty_Key",
           gfxAtlas = "assets/textures/gui/items_atlas.tga",
           gfxIndex = 5,
           weight = 0.5,
           traits = { "key" },
           description = "This key has seen better days."
         }
       }
    }
And the editor is not crashing, but the "rusty_key" isn't showing up at all to be placed. So what did I screw up this time?
Thanks for all your help, I'm gettin' there...slowly...

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 2:27 am
by Doridion
Try adding multiple = 1, just after weight.

Pressure plate -> script

Posted: Wed Nov 12, 2014 3:59 am
by QuintinStone
So I have a pressure plate that calls a function in a script entity on activation. Is there a way in the script to determine what object triggered the activation event? Only 1 parameter seems to be passed to the function, the pressure plate itself.

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 10:07 am
by Meshki
Meshki wrote:I want to create a Wall Trigger that will activate a magic bridge after shooting the wall with projectile (stones, arrows, anything) but can't seem to get it working. The wall trigger has projectile collider set and it actually stops the projectiles mid-air but doesn't trigger the connected entities. Thanks
Could I get some attention please? Thanks :-)

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 10:37 am
by Matlock19
Doridion wrote:Try adding multiple = 1, just after weight.
Nope, that didn't do it. The key still doesn't show up.
I'll mess with this for an hour or so, maybe I'll get it.

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 11:03 am
by Blichew
Matlock19 wrote:
Doridion wrote:Try adding multiple = 1, just after weight.
Nope, that didn't do it. The key still doesn't show up.
I'll mess with this for an hour or so, maybe I'll get it.
there's no such file as

Code: Select all

gfxAtlas = "assets/textures/gui/items_atlas.tga",
and this field isn't mandatory if you're using default item atlas.
Also, adding

Code: Select all

baseObject = "brass_key",
just before components block did the trick - key is showing in the editor and can be spawned.

Code: Select all

defineObject{
	name = "rusty_key",
	baseObject = "brass_key",
	components = {
		{
			class = "Model",
			model = "assets/models/items/key_brass.fbx",
		},
		{
			class = "Item",
			uiName = "Rusty Key",
			--gfxAtlas = "assets/textures/gui/items_atlas.tga",
			gfxIndex = 5,
			weight = 0.5,
			traits = { "key" },
			description = "This key has seen better days."
		},
	}
}

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 11:05 am
by Blichew
Meshki wrote:
Meshki wrote:I want to create a Wall Trigger that will activate a magic bridge after shooting the wall with projectile (stones, arrows, anything) but can't seem to get it working. The wall trigger has projectile collider set and it actually stops the projectiles mid-air but doesn't trigger the connected entities. Thanks
Could I get some attention please? Thanks :-)
If you can't get it to work, maybe set up a hidden floor trigger in fron of the wall, with option to activate only by item ?
Then you can try to check every entity that's on this tile for a .name property to check if it's an item of the desired type/name.

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 11:14 am
by Matlock19
Today you are my personal hero, Blichew. The key is perfect.

Well, if it's not one thing, it's yeah...check out my first attempt at working equipment:

Code: Select all

defineObject{
   name = "gibbs_cloak",
   baseObject = "bear_pelt",
   components = {
      {
         class = "Model",
         model = "assets/models/items/bear_pelt.fbx",
      },
      {
         class = "Item",
         uiName = "Gibb's Hide",
         gfxIndex = 320,
         weight = 1.5,
         --traits = { "equipment_item", "cloak" }, -- do i even need these?
         description = "Please work."
      },
	  {
	     class = "EquipmentItem",
		 slot = 5,
		 Protection = 2,
		 Evasion = 2,
		 Vitality = 2,
	  },
   } 
}
That item seems to work fine until you actually equip it. It doesn't really give any of those stats, though they appear in the tooltip properly. What big obvious thing am I missing here?

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 1:54 pm
by Decayer
Matlock19 wrote:Today you are my personal hero, Blichew. The key is perfect.

Well, if it's not one thing, it's yeah...check out my first attempt at working equipment:

Code: Select all

defineObject{
   name = "gibbs_cloak",
   baseObject = "bear_pelt",
   components = {
      {
         class = "Model",
         model = "assets/models/items/bear_pelt.fbx",
      },
      {
         class = "Item",
         uiName = "Gibb's Hide",
         gfxIndex = 320,
         weight = 1.5,
         --traits = { "equipment_item", "cloak" }, -- do i even need these?
         description = "Please work."
      },
	  {
	     class = "EquipmentItem",
		 slot = 5,
		 Protection = 2,
		 Evasion = 2,
		 Vitality = 2,
	  },
   } 
}
That item seems to work fine until you actually equip it. It doesn't really give any of those stats, though they appear in the tooltip properly. What big obvious thing am I missing here?
It's likely that Protection, Evasion and Vitality have to be all lower case.

Re: Ask a simple question, get a simple answer

Posted: Wed Nov 12, 2014 2:29 pm
by TheLastOrder
Hi there everybody. After looking as a crazy man in the reference list and several searchs on the forum, here we go:


then
kb_levers_door.door:open()
kb_teleport.teleport:isDeactivated()

The door opens, but the teleport isn't deactivated. the game crashes and returns me that it calls a nil value, when the kb_teleport actually EXISTS, I can see it and I can feel it xDDDD

I tried local kb_teleport = findEntity("kb_teleport"), but still the same problem.

And I tried :toggle or :deactivate

Nothing...

Thanks!!! :D