Emogma said:I searched the forums already but most of the questions regarding slot leads to the 2009 module system tutorial which i'm pretty sure is outdated so can anyone explain what slots are?
You should really check the modüle_system introduction threads for this. But to simply answer you question.CutContent said:whats the difference between slots and variables that start with :?
like ":cur_scene" I think the :variables compared to slots is like what quick strings is compared to normal strings right?
domipoppe said:EDIT: Tama was faster
you can only put integers.
Tama said:domipoppe said:EDIT: Tama was faster
you can only put integers.
You don't have to worry about that. Because everything has an integer number troops, agents, players everything equals to some integer. You don't have to understand it, at least yet. And you can't use float numbers anyway. So don't worry about integers or anything. You can perfectly store troop id's, agent id's into these : variables because almost everything has an integer equivalent.
kalarhan said:http://forums.taleworlds.com/index.php/topic,142422.0.html
there is a section dedicated to slots in that guide, and it is still relevant today (works the same)
domipoppe said:Tama said:domipoppe said:EDIT: Tama was faster
you can only put integers.
You don't have to worry about that. Because everything has an integer number troops, agents, players everything equals to some integer. You don't have to understand it, at least yet. And you can't use float numbers anyway. So don't worry about integers or anything. You can perfectly store troop id's, agent id's into these : variables because almost everything has an integer equivalent.
Well I meant only numbers as he maybe could try to put a string inside it.
Tama said:Emogma said:I searched the forums already but most of the questions regarding slot leads to the 2009 module system tutorial which i'm pretty sure is outdated so can anyone explain what slots are?
Actually, it shouldn't be outdated since as far as i remember slot operations didn't change all that time. Slots are basically advanced variables for the module system. When you want to assign a variable to something, you use slots. You can assign slots to troops, agents, multiplayer players, parties and the list goes on and on. Imagine it's a variable inside a class of some gameobject. And when you assign it that troop will have that variable.
(agent_slot_eq, ":player_agent", slot_agent_happy, 0), #You can make conditions like this one. This checks if the player_agent's slot_agent_happy variable is 0.
(agent_get_slot,":some_value",":player_agent",slot_agent_happy), #This stores the slot_agent_happy's variable into ":some_value"
(agent_set_slot,":player_agent",slot_agent_happy,":some_value"), #This assigns slot_agent_happy with the value inside the variable ":value"
Also check out module_constants for existing slots or making new ones like the guy above me suggested^^ Good luck.
Emogma said:Tama said:Emogma said:I searched the forums already but most of the questions regarding slot leads to the 2009 module system tutorial which i'm pretty sure is outdated so can anyone explain what slots are?
Actually, it shouldn't be outdated since as far as i remember slot operations didn't change all that time. Slots are basically advanced variables for the module system. When you want to assign a variable to something, you use slots. You can assign slots to troops, agents, multiplayer players, parties and the list goes on and on. Imagine it's a variable inside a class of some gameobject. And when you assign it that troop will have that variable.
(agent_slot_eq, ":player_agent", slot_agent_happy, 0), #You can make conditions like this one. This checks if the player_agent's slot_agent_happy variable is 0.
(agent_get_slot,":some_value",":player_agent",slot_agent_happy), #This stores the slot_agent_happy's variable into ":some_value"
(agent_set_slot,":player_agent",slot_agent_happy,":some_value"), #This assigns slot_agent_happy with the value inside the variable ":value"
Also check out module_constants for existing slots or making new ones like the guy above me suggested^^ Good luck.
So if i'm correct, I can have multiple slots act as parameters for something like
Bob has 3 slots, Age, Weight, and Favorite Color and I can change them?