logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
copy and paste row

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
DM_Vecna



Joined: 10 Feb 2010
Posts: 37

PostPosted: Mon Apr 05, 2010 6:38    Post subject: copy and paste row Reply with quote

Is there an efficient way to copy multiple adjacent cells from one database row to another?

I would like to copy about 20 adjacent columns where sNPC=X. Then start a new row on that same database and insert all of those values in the same columns.

Is there a smart way of doing this besides field by field?

I can give more of an explination if needed.

thanks for the help Smile
Back to top
View user's profile Send private message Send e-mail
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Apr 05, 2010 8:52    Post subject: Reply with quote

20 adjacent columns with the same entity type? Seems like your table structure isn't optimized.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
DM_Vecna



Joined: 10 Feb 2010
Posts: 37

PostPosted: Mon Apr 05, 2010 18:34    Post subject: Reply with quote

Sorry, Maybe I should have described it a little better.

This is a custom faction table

The columns are names of factions in my pw, they in turn match faction creatures hidden in my module.

I have a row for each faction creature (row 1-27 )as well as a row for each PC that starts playing in my module.

The fields are all reputation values (1-100) that reflect how the factions feel about each other. Thus replacing the Bioware faction system with a persistent one.

On the first time a player logs in to my module I would like the script to
- look at the PCs sub-race (which matches the faction names)
- start a new row for the PC with the first column being the value of a local (unique) int stores on the PC named "ID" (used this method instead of PC name thanks for Fireboar)
- Then fill the rest of the row based on the values found in the row where the PCs subrace matches the correct faction.

Any thoughts?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group