Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
I thought delayedCall only worked specifically with script functions? Is it supposed to work with any go in the game?
- QuintinStone
- Posts: 72
- Joined: Sat Nov 01, 2014 9:58 pm
Re: Ask a simple question, get a simple answer
Strangely, it works in another script I have:Grimfan wrote:I thought delayedCall only worked specifically with script functions? Is it supposed to work with any go in the game?
delayedCall(launchers[index], i-1, "activate")
The launcher array is a bunch of IDs of spawner objects. I must be just screwing something up.
Edit: Gah, ok, working now.
Crypt of Zulfar
- QuintinStone
- Posts: 72
- Joined: Sat Nov 01, 2014 9:58 pm
Re: Ask a simple question, get a simple answer
The syntax for delayedCall is:cameronC wrote:I just can't get delayedCall to work. I've combed through the various posts regarding it in other threads and the brief mention of it in the scripting ref but I think I'm completely misunderstanding it. I've tried many things to get a script function to be ran after X seconds and sometimes the editor crashes on delayedCall() and sometimes it passes through it fine but gives me an invalidconnector warning onscreen and nothing else happens.
If I have entityID with a functionName I want to run after X seconds, is that something this can do?
delayedCall(entity ID, delay in seconds, function name, function parameter 1, function parameter 2,...)
If your entity is a script, the function name should work. If it's a game object, your function name may have to be a controllercomponent function, I'm not sure.
Crypt of Zulfar
Re: Ask a simple question, get a simple answer
Hi I´d like to insert object "scroll" with some image I have. Scroll is isnide the sack (sack_3), which is placed in the alcove(dungeon_alcove_1).
Do I need to define that scroll completely ? Or is it possible to define the image on defualt scroll with ... scrollitem:setScrollImage("mod_assets/....") and then somehow specify where the scroll is ? (sack inside alcove)
edit: oh I found out I can actulay edit name of the scroll inside the sack inside the alcove. but when i tell:
myscroll.scrollitem:setScrollImage("mod_assets/....")
editor disagree with attempt to index global "myscroll" ( anil value)
Do I need to define that scroll completely ? Or is it possible to define the image on defualt scroll with ... scrollitem:setScrollImage("mod_assets/....") and then somehow specify where the scroll is ? (sack inside alcove)
edit: oh I found out I can actulay edit name of the scroll inside the sack inside the alcove. but when i tell:
myscroll.scrollitem:setScrollImage("mod_assets/....")
editor disagree with attempt to index global "myscroll" ( anil value)
-
- Posts: 168
- Joined: Thu Oct 30, 2014 1:56 am
Re: Ask a simple question, get a simple answer
can't you just do \
Code: Select all
local scroll = findEntity("Your_Scroll_ID")
scroll.scrollitem:setScrollImage("mod_assets/....")
--do stuff to scroll
Re: Ask a simple question, get a simple answer
not working. Seems like this is bug. When I place scroll just inside alcove or some contaihner its ok. But when scroll is inside sack inside alcove, editor crashing with this global nil...GoldenShadowGS wrote:can't you just do \
Code: Select all
local scroll = findEntity("Your_Scroll_ID") scroll.scrollitem:setScrollImage("mod_assets/....") --do stuff to scroll
kind of weird :/
Re: Ask a simple question, get a simple answer
What if you put it in the sack/alcove via script after you've added the image on?
Code: Select all
my_scroll.scrollitem:setScrollImage("mod_assets/....")
my_sack.containeritem:addItem(my_scroll)
my_alcove.surface:addItem(my_sack)
Re: Ask a simple question, get a simple answer
treasure_map_1.scrollitem:setScrollImage("mod_assets/portraits/prvnimapapokladu.dds")Scotty wrote:What if you put it in the sack/alcove via script after you've added the image on?
Code: Select all
my_scroll.scrollitem:setScrollImage("mod_assets/....") my_sack.containeritem:addItem(my_scroll) my_alcove.surface:addItem(my_sack)
dungeon_alcove_1.surface:addItem(sack_3)
sack_3.containeritem:addItem(treasure_map_1)
error on second row - bad argument 1 to additem (itemcomponent expected, got ???)
EDIT: ok iam trying to edit the scroll directly as item. why the hell it is not working now ?
Code: Select all
defineObject{
name = "treasure_map_1",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/note.fbx",
},
{
class = "Item",
uiName = "Scroll",
gfxIndex = 454,
weight = 0.1,
},
{
class = "ScrollItem",
setScrollImage = ("mod_assets/portraits/prvnimapapokladu.dds"),
},
},
}
-
- Posts: 168
- Joined: Thu Oct 30, 2014 1:56 am
Re: Ask a simple question, get a simple answer
because you need to remove "set" when defining
Code: Select all
{
class = "ScrollItem",
ScrollImage = ("mod_assets/portraits/prvnimapapokladu.dds"),
},
Re: Ask a simple question, get a simple answer
ha, got it working finally ! thanks alot.GoldenShadowGS wrote:because you need to remove "set" when defining
Code: Select all
{ class = "ScrollItem", ScrollImage = ("mod_assets/portraits/prvnimapapokladu.dds"), },