LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



Go to page : 1, 2, 3, 4, 5  Next

View previous topic View next topic Go down Message [Page 1 of 5]

The only one
The only one
#1 Lumberjack script. In progress again... Empty Lumberjack script. In progress again...
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
Welcome in my first real script post!
Spoiler:
Script (is finish but, with errors):

Last edit: 11/10/11 at 19:27
Reason: Polish & fix bug
Spoiler:
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
EVENTALIST
EVENTALIST
#2 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Good start but i noticed a few errors.


  • Too many global variables
  • Misuse of the Hash class
  • You wont be able to save your wood level when loading a game.


You have a nice base, you should go back and revise.
EVENTALIST
Show Signature
EVENTALIST
The only one
The only one
#3 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
It's why I wrote: "I need to polish my script."
Maybe that will take more time than I said. I have 9 hours at school. I'm back at 6h, I can have the computer at max 9h pm...

And,
how I can save when I load?
how to use correctly the hash class? What's wrong with?
OH! and I need to learn more about complex randomization and I can't find any good tutorials about that!

I need a short tutorial about randomization in RGSS. I know only rand(value).

Someone can say me:
-how to make a variable is choose randomly between six.
-if the player lvl is between 1 or 9, give an item with a random quantity between 1 to 5
-put a random in a if statement. Like: you have 6 possibilities, you have 1 chance on 100 than the first accomplished. You have 1 chance on 50 than the second accomplished... If the first or the second or the third or... Do that. Else, do this:...
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
EVENTALIST
EVENTALIST
#4 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
part of learning is trial and error, there is an example of the built in rand() function, just apply it to what you need to get the job done.
EVENTALIST
Show Signature
EVENTALIST
The only one
The only one
#5 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
@mr_wiggles: I found how for the rand
For a number between 1 and 6:
Code:
rand(6) + 1 # 1 - 6 inclusive
rand(6) # 0 - 6 exclusive
rand(7) # 0 - 6 inclusive

For Character between level 1-9 :
Code:
if woodcutting_lvl >= 1 && woodcutting_lvl <= 9
  #give character ( rand(4) + 1 ) for the number of items
end

And for chances, you can do this:
Code:


if rand(100) == 0 # 1 in 100 chance
  #code
end

if rand(50) == 0 # 1 in 50 chance
  #code
end


But the hash, I did'nt understand!


EDIT: Like that, that 'll be ok?

Spoiler:
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
EVENTALIST
EVENTALIST
#6 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
What i ment with the hash is that its used to tie tow things together.

Code:

{
#Here, you can add logs ID in the item database for defferent logs type.
100, #It's a normal log
101,
102,
103,
104,
105,
106,
107,
108,
109
}

See here where you just have one thing, you should change it to an array.

Hash is used when you want to do something like:

cat => feline, dog => canine
dirt => earth, rain => water

its sorta used as a definition of what something is. This is useful for stuff like keyboard character mapping.
EVENTALIST
Show Signature
EVENTALIST
The only one
The only one
#7 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
Can I do something shorter than that?

Code:
# If the logs type = to "A",
#the amount of gain xp is multiplied by the logs number and divided by 2.
  @logs_type = {
  10,5,4,3,2,1.5
  }
  def logs_type_value
    if @logs_type = 10
      @logs_type = A
    else if @logs_type = 5
      @logs_type = B
    else if @logs_type = 4
      @logs_type = C
    else if @logs_type = 3
      @logs_type = D
    else if @logs_type = 2
      @logs_type = E
    else if @logs_type = 1.5
      @logs_type = F
  end
end

Code:
#----If the player cctt variables is equal or greater to 1, -------------------#
#----player can cut tree type 1------------------------------------------------#

if $tree_type = 1
  if @cctt >= 1
    can_cut = true
  end

else if $tree_type = 2
  if @cctt >= 2
    can_cut = true
  end

else if $tree_type = 3
  if @cctt >= 3
    can_cut = true
  end

else if $tree_type = 4
  if @cctt >= 4
    can_cut = true
  end

else if $tree_type = 5
  if @cctt >= 5
    can_cut = true
  end

else if $tree_type = 6
  if @cctt >= 6
    can_cut = true
  end

else if $tree_type = 7
  if @cctt >= 7
    can_cut = true
  end

else if $tree_type = 8
  if @cctt >= 8
    can_cut = true
  end

else if $tree_type = 9
  if @cctt >= 9
    can_cut = true
  end

else if $tree_type = 10
  if @cctt = 10
    can_cut = true
  end

else
  can_cut = false
end
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
EVENTALIST
EVENTALIST
#8 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
SO you basically are checking to see if the players level is high enough to cut the tree?

why not something like this:
Code:

class interpreter
def can_cut?(wood_level)
return ($game_party.wood_cut_level >= wood_level)
end
end

This way in an event for the tree you can just run a conditional branch command using the code feature and type can_cut?(wood_level) and then take it from there.
EVENTALIST
Show Signature
EVENTALIST
The only one
The only one
#9 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
I've edited the script recently. I'll use your trick later. Can you look it? I have an error at the last line with or without the "Woodcutting.new".
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
Administrator
Administrator
#10 Lumberjack script. In progress again... Empty Re: Lumberjack script. In progress again...
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
wow Nuka - you pick up super quick!
at the rate you are learning, you'll be able to script on your own soon. Cool

it's just a guess but try "$Woodcutting = true"
I'll make some time to actually test yours once I'm done with a few scripts that I'm currently working on...

keep up the great work!

I always say it

It's not what and how you start

it's when and the way you finish it ^,^

Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 5]

Go to page : 1, 2, 3, 4, 5  Next

 

Chatbox system disabled
Personal messaging disabled