Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 6 1 2 3 4 5 6
Script Factory #127640
05/02/07 13:35
05/02/07 13:35
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
I´m a bit bored and I´d like to script something. Following aztec, DwX and all the others before, I offer you, to post what kind of Script you´d like to have and I will try to realize it and post the working script here.

What I won´t do is pathfinding and menues.

Thanks
Slin

Re: Script Factory [Re: Slin] #127641
05/02/07 13:56
05/02/07 13:56
Joined: Mar 2005
Posts: 969
ch
Loopix Offline
User
Loopix  Offline
User

Joined: Mar 2005
Posts: 969
ch
How about a simple script for handling a custom player name? Should be possible to:
-input the name string somewehre in the startmenu of the game
-calling the string (player name) whenever I want to

I know, this is not really challenging for you...but it would save me at least an hour

Re: Script Factory [Re: Slin] #127642
05/02/07 13:59
05/02/07 13:59
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
Quote:

I´m a bit bored and I´d like to script something. Following aztec, DwX and all the others before, I offer you, to post what kind of Script you´d like to have and I will try to realize it and post the working script here.

What I won´t do is pathfinding and menues.

Thanks
Slin




First time ever that I´m an activator of something
hey but what I allways wanted to have is something like if you click on an object a text field opens where you can write something in.
now if thats right a new event happens
Regards
Aztec


Visit:
schwenkschuster-design.de
Re: Script Factory [Re: aztec] #127643
05/02/07 14:48
05/02/07 14:48
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Loopix:
Code:

font font_Player = "arial",1,20;
string str_PlayerName = "Player";

text txt_PlayerNameIn
{
pos_x = 0;
pos_y = 0;
layer = 15;
font = font_Player;
strings = 2;
string = "Player Name: ",str_PlayerName;
}

function func_PlayerNameIn(PosX,PosY,SizeX,SizeY)
{
txt_PlayerNameIn.Pos_x = PosX;
txt_PlayerNameIn.Pos_y = PosY;

SizeX += PosX;
SizeY += PosY;

txt_PlayerNameIn.visible = on;

while(txt_PlayerNameIn.visible)
{
if( mouse_left
&& mouse_pos.x > PosX && mouse_pos.x < SizeX
&& mouse_pos.y > PosY && mouse_pos.y < SizeY)
{
inkey(str_PlayerName);
}

wait(1);
}
}



Just call the function "func_PlayerNameIn(PosX,PosY,SizeX,SizeY)" if you want to change the playername. PosX and PosY is the Position where the name gets displayed. You´ll have to click on the displayed text to change it so you have to say how big the text is with SizeX and SizeY.
If you want to make it invisible, just call txt_PlayerNameIn.visible = off; out of a function. The player name is stored in the string "str_PlayerName".

@aztec: I will try it when I´m done with my homework. It shouldn´t be very hard either

Last edited by Slin; 05/02/07 14:56.
Re: Script Factory [Re: Slin] #127644
05/02/07 14:54
05/02/07 14:54
Joined: Mar 2005
Posts: 969
ch
Loopix Offline
User
Loopix  Offline
User

Joined: Mar 2005
Posts: 969
ch
Wow...that was fast! Thanks a lot for this...you 're the champ

Re: Script Factory [Re: Loopix] #127645
05/02/07 18:42
05/02/07 18:42
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline

Expert
Realspawn  Offline

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
i added this fun code to my wdl library online

thx

http://www.realspawn-productions.com/wdl/wdlindex


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Script Factory [Re: Loopix] #127646
05/02/07 18:42
05/02/07 18:42
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
This should be, what you are looking for aztec:

Code:

define EventString_count, 3; //Number of instructions

font font_EventInput = "arial",1,20;
string str_EventInput;

text txt_EventInput
{
pos_x = 0;
pos_y = 0;
layer = 15;
font = font_EventInput;
strings = 2;
string = "Instruction: ",str_EventInput;
}

text txt_EventInput_strings
{
strings = EventString_count;
string = "help","talk","trade"; //these are the posible instructions
}

function func_CompareStrings(StringIn) //Compare the strings
{
var counter;
while(counter < EventString_count)
{
if(str_cmpi(StringIn,txt_EventInput_strings.string[counter])){return(counter);}
counter += 1;
}
}

function func_EventInput(PosX,PosY)
{
var InkeyReturn;
var InstructionID;

txt_EventInput.Pos_x = PosX;
txt_EventInput.Pos_y = PosY;

txt_EventInput.visible = on;

InkeyReturn = inkey(str_EventInput);
if(1 < InkeyReturn < 27)
{
InstructionID = func_CompareStrings(str_EventInput);
}

txt_EventInput.visible = off;

if(InstructionID == 0) //if the input was help,
{
wait(1); //do something
}
if(InstructionID == 1) //if the input was talk,
{
wait(1); //do something
}
if(InstructionID == 2) //if the input was trade,
{
wait(1); //do something
}
}

function func_MdlEventInput_event()
{
if(event_type == event_click)
{
func_EventInput(mouse_pos.x,mouse_pos.y); //Place the text at the mouse position
}
}

action func_MdlEventInput() //Example Action
{
my.enable_click = on;
my.event = func_MdlEventInput_event;
}



Re: Script Factory [Re: Slin] #127647
05/02/07 19:04
05/02/07 19:04
Joined: Oct 2005
Posts: 612
Inari Offline
User
Inari  Offline
User

Joined: Oct 2005
Posts: 612
cool idea

Re: Script Factory [Re: Inari] #127648
05/02/07 19:17
05/02/07 19:17
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline

Expert
Realspawn  Offline

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
keep this work up
grinnn 2 codes more in the library


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Script Factory [Re: Realspawn] #127649
05/02/07 19:29
05/02/07 19:29
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Nice library, Realspawn

@all: I´ve got some time so please post what you´d like to get scriptet...


Slin

Page 1 of 6 1 2 3 4 5 6

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1