Carda's bunch of daily Lua questions
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Re: Script command to give XP to a unit?
Two more questions if that's allowed (if not, I'll put my questions in one of the fixed topics on top)
While playing the map around turn 20 I need to let the players view the complete map. At the start its clouded which is OK. Then around turn 25 everything must switch back to: players only see where they actually are.
[event]
name="turn 20"
???? <---- need to enter the script to remove all view restrictions (players must see complete map)
[/event]
[event]
name="turn 25"
???? <---- make it foggy again (only see the area around the units)
[/event]
Thanks again
P.S. Tried consulting the online Lua Wesnoth manual first but I have no clue where to start looking. Luckely Bob's RPG maps help me a lot learning about triggers and such.
While playing the map around turn 20 I need to let the players view the complete map. At the start its clouded which is OK. Then around turn 25 everything must switch back to: players only see where they actually are.
[event]
name="turn 20"
???? <---- need to enter the script to remove all view restrictions (players must see complete map)
[/event]
[event]
name="turn 25"
???? <---- make it foggy again (only see the area around the units)
[/event]
Thanks again
P.S. Tried consulting the online Lua Wesnoth manual first but I have no clue where to start looking. Luckely Bob's RPG maps help me a lot learning about triggers and such.
10 FOR X = 0 TO 15
20 POKE 53280,X ; PRINT " Hello World"
30 NEXT X
40 GOTO 10
20 POKE 53280,X ; PRINT " Hello World"
30 NEXT X
40 GOTO 10
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Script command to give XP to a unit?
[modify_side]
side=<side_number>
shroud=yes|no
fog=yes|no
[redraw]
for all sides in the scenario.
side=<side_number>
shroud=yes|no
fog=yes|no
[redraw]
for all sides in the scenario.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Carda's bunch of daily Lua questions
Computed it to this:
[modify_side]
side="1,2,3,4,5"
shroud="no"
fog="no"
[/modify_side]
[redraw]
[/redraw]
Another quick reply,
Thanks
[modify_side]
side="1,2,3,4,5"
shroud="no"
fog="no"
[/modify_side]
[redraw]
[/redraw]
Another quick reply,
Thanks
10 FOR X = 0 TO 15
20 POKE 53280,X ; PRINT " Hello World"
30 NEXT X
40 GOTO 10
20 POKE 53280,X ; PRINT " Hello World"
30 NEXT X
40 GOTO 10
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Carda's bunch of daily Lua questions
modify_side doesn't allow comma-separated list for side=
And your question has nothing to do with lua.
And your question has nothing to do with lua.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Carda's bunch of daily Lua questions
I'm sorry if this isn't Lua. I have a feeling i'm coding two languages through eachother here. But glad that it all still hangs on. Progress on the map and scripts is steadily going forward.
Now however I encountered a problem and I would like you to take a look if the next coding is valid (does it work?):
[event]
name=die
[filter]
name="Bluto"
[/filter]
{VARIABLE_OP gooddied add 1}
[/event]
Does it add 1 to the variable gooddied when a creature called Bluto gets killed?
Thanks again all. If the above code is valid my error must be somewhere else.
Now however I encountered a problem and I would like you to take a look if the next coding is valid (does it work?):
[event]
name=die
[filter]
name="Bluto"
[/filter]
{VARIABLE_OP gooddied add 1}
[/event]
Does it add 1 to the variable gooddied when a creature called Bluto gets killed?
Thanks again all. If the above code is valid my error must be somewhere else.
10 FOR X = 0 TO 15
20 POKE 53280,X ; PRINT " Hello World"
30 NEXT X
40 GOTO 10
20 POKE 53280,X ; PRINT " Hello World"
30 NEXT X
40 GOTO 10
-
- Posts: 1549
- Joined: June 18th, 2009, 1:45 am
Re: Carda's bunch of daily Lua questions
If gooddied is an existent numeric variable, then yes. I suspect you might not have defined gooddied earlier.
What you are coding is called WML. Lua looks completely different: http://svn.gna.org/viewcvs/wesnoth/trun ... iew=markup
What you are coding is called WML. Lua looks completely different: http://svn.gna.org/viewcvs/wesnoth/trun ... iew=markup
Re: Carda's bunch of daily Lua questions
Code: Select all
[filter]
name="Bluto"
[/filter]