Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, Ayumi, VHX, monarch), 1,161 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Need help with idea for text window in rpg game. [Re: paracharlie] #338297
08/16/10 23:29
08/16/10 23:29
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
slight edit
Code:
#include <acknex.h>
#include <default.c>

int int_logPos;
TEXT* txt_log = {
	layer = 10;
	strings = 10;
	flags = SHOW;
}

void logger(STRING* str){
	
	int i;
	
	if(int_logPos < txt_log.strings){
		str_cpy((txt_log.pstring)[int_logPos], str);
		int_logPos++;
	}else{
		
		for(i = 0; i < txt_log.strings-1; i++){
			str_cpy((txt_log.pstring)[i],(txt_log.pstring)[i+1]);
		}
		
		if(str){
			str_cpy((txt_log.pstring)[txt_log.strings-1],str);
		}else{
			str_cpy((txt_log.pstring)[0],"");
		}
	}
}

#define waiter -0.5
void logger_startup(){
	
	int i;
	for(i = 0; i < txt_log.strings; i++){
		(txt_log.pstring)[i] = str_create("");
	}
	
	wait(waiter);
	logger("THIS");
	wait(waiter);
	logger("IS");
	wait(waiter);
	logger("HOW");
	wait(waiter);
	logger("IT");
	wait(waiter);
	logger("WORKS");
	wait(waiter);
	
	logger("JUST");
	wait(waiter);
	logger("KEEP");
	wait(waiter);
	logger("SENDING");
	wait(waiter);
	logger("logger(\"input\")");
	wait(waiter);
	logger("UNTIL");
	wait(waiter);
	logger("YOU");
	wait(waiter);
	logger("GET");
	wait(waiter);
	logger("BORED");
	wait(waiter);
	logger(":)");
	wait(waiter);
}

will now start from line 1(0), then scroll

for everything else...
Code:
#define chattable skill80
void mouse_rightClick(){
  
  if(mouse_ent){ //if hit entity
    
    if(vec_dist(mouse_ent.x, player.x) < 100){ //if player in range of clicked target
      
      if(mouse_ent.chattable){ //skill set on entity so you can't talk to trees and terrain etc...
      	
      	set(pnl_chatBG, SHOW); //rename for your chat BG
      	logger("Pumpkin Pie sir?);
      	//do however you're handling chat here...
      }
    }
  }
}

void main(){
  //...
  on_mouse_right = mouse_rightClick;
  //...
}

*totally untested*

Re: Need help with idea for text window in rpg game. [Re: MrGuest] #338298
08/17/10 00:07
08/17/10 00:07
Joined: Mar 2009
Posts: 146
USA
P
paracharlie Offline OP
Member
paracharlie  Offline OP
Member
P

Joined: Mar 2009
Posts: 146
USA
Yes it works! I cant thank you enough for making my idea a reality. Thank you very much for taking the time to do this. This is exactly the way I envisioned it working.

At the same time I just learned alot from your code on using pstrings. This has been a very foggy area for me for awhile, but I have learned a great deal by looking at your code, thank you.

Now to add text to a panel for the purpose of being able to drag a panel about I can still do something like this since its a function.

logger(str_cpy(npc_message,"Pumpkin Pie sir?")); and that appears to be working also.

Last edited by paracharlie; 08/17/10 01:20.

A8 Commercial
Re: Need help with idea for text window in rpg game. [Re: paracharlie] #338315
08/17/10 05:24
08/17/10 05:24
Joined: Jul 2010
Posts: 127
Germany, Herford
Ditje Offline
Member
Ditje  Offline
Member

Joined: Jul 2010
Posts: 127
Germany, Herford
@ MrGuest: Yeah - I`ve learned something about handling strings, too. laugh

THX

Ditje

Re: Need help with idea for text window in rpg game. [Re: Ditje] #338494
08/18/10 15:22
08/18/10 15:22
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
For what its worth, seeing as MrGuest has beaten me again,
HERE is a little something I put together in the last few days.

It may be of interest to you guys, even if its too late to be useful....


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Need help with idea for text window in rpg game. [Re: EvilSOB] #338552
08/19/10 00:13
08/19/10 00:13
Joined: Mar 2009
Posts: 146
USA
P
paracharlie Offline OP
Member
paracharlie  Offline OP
Member
P

Joined: Mar 2009
Posts: 146
USA
I've already started plugging into my rpg and I have to say everything now looks so much more professional with my combat windows, message windows just like the pro's. HUGE contribution to the community, cant thank you guys enough. I hope others see the power, ease and flexibility of these (plugin's) basically, I guess you could call it.


A8 Commercial
Re: Need help with idea for text window in rpg game. [Re: paracharlie] #338826
08/21/10 21:40
08/21/10 21:40
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline
Senior Member
sadsack  Offline
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
very nice EvilSOB
renny


I have A7 Commercial .............. Now I just need to learn how to use it

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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