is it possible to disable the spin attack?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#17
Development / [Solved]How do I print a string to txt file?
April 08, 2017, 01:36:44 AM
That is exactly what I wanted. Thank you Zefk!
#18
Development / How to read a specific line in a text file?
April 07, 2017, 08:41:13 AM
I was wondering if there was a way to read specific lines and remove them if necessary.
Like this:
http://www.computercraft.info/forums2/index.php?/topic/2886-luahow-to-readwrite-certain-lines-in-files/page__view__findpost__p__21538
Like this:
http://www.computercraft.info/forums2/index.php?/topic/2886-luahow-to-readwrite-certain-lines-in-files/page__view__findpost__p__21538
#19
Development / (Solved)Movements with camera?
April 07, 2017, 06:40:08 AM
Thank you Christopho! It works now.
Code ( lua) Select
local straight = sol.movement.create("straight")
straight:set_angle(3)
straight:start(map:get_camera())
#20
Development / [Solved]Movements with camera?
April 07, 2017, 04:44:24 AM
I was trying to move the camera, but how do I move an entity without a name? Is it possible to create a name for the camera?
Code ( lua) Select
local straight = sol.movement.create("straight")
straight:set_angle(3)
straight:start(camera)
#21
Development / Re: How do I make a circle movement?
April 03, 2017, 09:33:45 PM
I tried the following, but it did nothing. I normally would do this for an enemy to use the 4 way directions.
Code ( lua) Select
function gerf:on_movement_changed()
sprite:set_direction(movement:get_direction4())
end
#22
Development / Re: How do I make a circle movement?
April 03, 2017, 07:11:41 PM
llamazing is correct. I did that and changed my radius to 20. Is it possible to have the sprite use all 4 facing directions when going around an entity or would it be better to loop with the path movement?
Code ( lua) Select
local circle = sol.movement.create("circle")
circle:set_center(chest1)
circle:set_loop_delay(1000)
circle:set_angle_speed(100)
circle:set_duration(100)
circle:set_max_rotations(100)
circle:set_initial_angle(100)
circle:set_clockwise(true)
circle:set_radius(20)
circle:set_radius_speed(1)
circle:set_ignore_obstacles(true)
circle:start(gerf)
#23
Development / (Solved)Table?
April 03, 2017, 08:14:52 AM
Oh, forgot it was in pixels. All is good now. Thank you for your help Diarandor!
#24
Development / Re: Table?
April 03, 2017, 07:39:50 AM
Thank you Diarandor! That solved my first problem.
Now the problem is that the NPC does not move at all. I tried multiple different coordinates of x,y. Strangly, the sprite vanishes with:
Full code:
Now the problem is that the NPC does not move at all. I tried multiple different coordinates of x,y. Strangly, the sprite vanishes with:
Code ( lua) Select
pixel:set_ignore_obstacles(true)
Full code:
Code ( lua) Select
function map:on_started()
local pixel = sol.movement.create("pixel")
pixel:set_trajectory{{64,80},{368,384}}
pixel:set_loop(true)
pixel:set_ignore_obstacles(true)
pixel:start(gerf)
end
#25
Development / (Solved)Table?
April 03, 2017, 03:23:56 AM
I have been trying to figure out the error with my table for the pixel movement.
and I tried:
Quotetrajectory (table): An array of all successive translations to make. Each translation should be an array of two integers (x and y).
Code ( lua) Select
local table1 = {244,270}
pixel:set_trajectory(table1)
pixel:start(gerf)
and I tried:
Code ( lua) Select
pixel:set_trajectory{244,270}
pixel:start(gerf)
Code Select
[2150] Error: In on_started: [string "maps/Map_4.lua"]:83: bad argument #3 to set_trajectory (table expected, got number)
#26
Development / Re: How do I make a circle movement?
April 02, 2017, 08:50:45 PM
So is this a bug?
#27
Development / Re: How do I make a circle movement?
April 02, 2017, 08:13:24 PM
The NPC works with random_path and jump, so it is not stuck.
Full code:
The only time anything happens is when I do the following.
Full code:
Code ( lua) Select
local map = ...
local game = map:get_game()
local hero = map:get_hero()
function map:on_started()
local circle = sol.movement.create("circle")
circle:set_center(chest1,248,357)
circle:set_loop_delay(2000)
circle:set_angle_speed(200)
circle:set_duration(2000)
circle:set_max_rotations(10)
circle:set_initial_angle(360)
circle:set_clockwise(true)
circle:set_radius(360)
circle:set_radius_speed(60)
circle:start(gerf)
end
The only time anything happens is when I do the following.
Code ( lua) Select
local map = ...
local game = map:get_game()
local hero = map:get_hero()
function map:on_started()
local circle = sol.movement.create("circle")
circle:set_radius(360)
circle:start(gerf)
end
#28
Development / Re: How do I make a circle movement?
April 02, 2017, 07:07:32 PM
It is still just standing there. No error outputs.
Code ( lua) Select
local circle = sol.movement.create("circle")
circle:set_center(chest1,248,357)
circle:set_loop_delay(2000)
circle:set_angle_speed(200)
circle:set_duration(2000)
circle:set_max_rotations(10)
circle:set_initial_angle(360)
circle:set_clockwise(true)
circle:set_radius(360)
circle:set_radius_speed(60)
circle:start(gerf)
#29
Development / [Solved]How do I make a circle movement?
April 02, 2017, 10:51:06 AM
I am having trouble with this because my npc is not making a circle movement. I want the NPC (gerf) to circle around a entity (chest1).
Code ( lua) Select
local circle = sol.movement.create("circle")
circle:set_center(chest1,248,357)
circle:start(gerf)
#30
Development / (Solved)Sword variants?
March 25, 2017, 01:03:42 AM
Thanks again Zefk! The sword variant change is working.