Stonewall382
Knight at Arms

Allo, I've a few questions.
1) Is it possible to execute a return in Python? I'm setting slots for a bunch of different castles, and the only way I can do it right now is by setting the value and then executing everything, then changing the value, and copy-pasting all the code again. I want to just assign the variable "$castle" (as you'll see below) to the next castle in the line, and return to the beginning of the operation--thereby making the code a lot more efficient. Here's the code I'm using:
(Shortened for "readibility")
2) How many slots does a party have? I thought Winter said once that they only have 500, but I'm not sure. I'd like to know, so that I can plan how I'm going to use them all.
Thank you to anyone who responds.
1) Is it possible to execute a return in Python? I'm setting slots for a bunch of different castles, and the only way I can do it right now is by setting the value and then executing everything, then changing the value, and copy-pasting all the code again. I want to just assign the variable "$castle" (as you'll see below) to the next castle in the line, and return to the beginning of the operation--thereby making the code a lot more efficient. Here's the code I'm using:
插入代码块:
(24, 72, 0), [],
[(try_begin),
(assign,"$castle","p_castle1"),# We're dealing with Culmarr's Level 1 Buildings now
(try_begin),# Begins the operation with the woodcutter
(party_get_slot,"$building","$castle",200),# We're dealing with the woodcutter here
(party_get_slot,reg(16),"$castle",499),# Extracting the number of building crews--we subtract one in the dialog if the player decides to build the building
(eq,"$building",1),# Checks to see if construction has begun (in the dialog with the NPC)
(party_set_slot,"$castle","$building",2),# When the building's slot is 1, it's being built. When it's completed, the slot is changed to 2.
(val_add,reg(16),1),# We return the building crew to be used again, then reset the slot with the correct value
(party_set_slot,"$castle",499,reg(16)),# This is where we actually reset the slot with the correct value
(try_end),# Ends the operation with the woodcutter
(try_begin),
(party_get_slot,"$building","$castle",201),
(party_get_slot,reg(16),"$castle",499),
(eq,"$building",1),
(party_set_slot,"$castle","$building",2),
(val_add,reg(16),1),
(party_set_slot,"$castle",499,reg(16)),
(try_end),
(try_end),
2) How many slots does a party have? I thought Winter said once that they only have 500, but I'm not sure. I'd like to know, so that I can plan how I'm going to use them all.
Thank you to anyone who responds.


