people playing: 194, servers online: 61, games played: 136,945,326 Top Player: kpokoLOL

  Toribash Community » Toribash » Mods » Lua scripts
Register FAQ General Rules Community
Reply
 
Thread Tools Display Modes
Old Jan 24, 2008   #21
Nuyashaki
Member
 
Black Belt
Join Date: Dec 2007
Posts: 406



Is there anyway to make, for example, newgrenade.lua push ALL objects (and players[Won't work in 4 player]), as well as environmental objects?
Nuyashaki is offline   Reply With Quote
Old Jan 24, 2008   #22
Blam
Now I know my abc's!
This user title is the property of SkulFuk.
 
4th Dan Black Belt
Join Date: Apr 2007
Posts: 5,507
Clan: bncy



not sure about 4 players. Edit the script to see if it can.
Enviroment objects = no.
:D
Blam is offline   Reply With Quote
Old Jan 24, 2008   #23
Nuyashaki
Member
 
Black Belt
Join Date: Dec 2007
Posts: 406



Can scripts interact with Environmental objects at all?
Edit: I gave it a whack and failed. I failed so bad, I made it worse. Now you won't fracture or dismember. I think it's because there is no player3 and player4 variable in lua.

Last edited by Nuyashaki; Jan 24, 2008 at 06:57 PM..
Nuyashaki is offline   Reply With Quote
Old Jan 24, 2008   #24
Blam
Now I know my abc's!
This user title is the property of SkulFuk.
 
4th Dan Black Belt
Join Date: Apr 2007
Posts: 5,507
Clan: bncy



You can do the same to players 3 and 4 as you can to uke and tori.

The script i attached is random.lua but it makes all 4 players have random joints.
:D

Last edited by Blam; Mar 29, 2008 at 10:27 AM..
Blam is offline   Reply With Quote
Old Jan 25, 2008   #25
Nuyashaki
Member
 
Black Belt
Join Date: Dec 2007
Posts: 406



Ack! Dammit. I don't understand it with my noobyness. T.T
Nuyashaki is offline   Reply With Quote
Old Jan 26, 2008   #26
taptappogi
Member
 
Blue Belt
Join Date: Jan 2008



wow
tnx for clearing this out
taptappogi is offline   Reply With Quote
Old Jan 26, 2008   #27
RicH
Forumite
 
10th Dan Black Belt
Join Date: May 2007
Posts: 1,922



How does draw_text function work?

I can't seem to make a string of text appear on screen.
RicH is offline   Reply With Quote
Old Jan 26, 2008   #28
Blam
Now I know my abc's!
This user title is the property of SkulFuk.
 
4th Dan Black Belt
Join Date: Apr 2007
Posts: 5,507
Clan: bncy



From SDK:
-- draw__text(string text, number pos_y [, integer font_type])

-- USE: Draws text on the screen
-- NOTES: -

local function draw_text_example()
set_color(0, 0, 0, 1)
draw_text("THIS... IS... TORIBASH!", 100, 100)
end

add_hook("draw2d", "draw_text_example", draw_text_example)

Makesure its in a "draw2d" hook.
:D
Blam is offline   Reply With Quote
Old Jan 26, 2008   #29
RicH
Forumite
 
10th Dan Black Belt
Join Date: May 2007
Posts: 1,922



Aahhh....

Last edited by RicH; Jan 26, 2008 at 01:18 PM..
RicH is offline   Reply With Quote
Old Jan 28, 2008   #30
flamflim
Junior Member
 
Black Belt
Join Date: Dec 2007
Posts: 29



I've been trying to make a script that allows you to rewind the game. It correctly sets the positions of the joints and bodyparts, but not the orientation of the bodyparts. I've tried using get_body_info(player,part).sides, but this function always returns the same answer, no matter what the orientation is.

Also if I use set_body_sides with different data it causes toribash to crash.

Code:
-- replay_rewind do local joint_poss = {} -- done local body_infos = {} local grip_states = {} local body_infos = {} -- doing local body local body_angular_vels = {} local nody_linear_vels = {} local current_frame = 1 local function enter_frame() world_state = get_world_state() match_frame = world_state.match_frame joint_poss[match_frame] = {} body_infos[match_frame] = {} echo("match_frame = "..match_frame) for p=0,1,1 do joint_poss[match_frame][p] = {} body_infos[match_frame][p] = {} for temp,j in pairs(JOINTS) do x,y,z=get_joint_pos(p,j) joint_poss[match_frame][p][j] = {x,y,z} end for temp,j in pairs(BODYPARTS) do body_infos[match_frame][p][j] = get_body_info(p,j) end end end local function set_tori() if joint_poss[current_frame]==nil then echo ("current frame does not exist") else for p=0,1,1 do for temp,j in pairs(JOINTS) do jp = joint_poss[current_frame][p][j] echo ("p="..p.." j="..j.." jp[1]="..jp[1]) set_joint_pos(p, j, jp[1], jp[2], jp[3]) end for temp,j in pairs(BODYPARTS) do bp = body_infos[current_frame][p][j].pos set_body_pos(p,j, bp.x, bp.y, bp.z) bs = body_infos[current_frame][p][j].sides set_body_sides(p,j, bs.x, bs.y, bs.z) end end end end local function key_down(key) if key==string.byte('[') then current_frame = current_frame - 1 echo ("current_frame = "..current_frame) set_tori() return 1 end if key==string.byte(']') then current_frame = current_frame + 1 echo ("current_frame = "..current_frame) set_tori() return 1 end end add_hook("enter_frame","replay_rewind", enter_frame) add_hook("key_down", "replay_rewind", key_down) end
flamflim is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:34 PM.




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
ragdoll fighting game physics fighting game ragdoll fighting physics funmotion joints martial arts karate pc mac free game turn based game