Hacking base files (split topic)

Forum For Privateer Remake
Post Reply
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

I have attached an agricultural.py and New_Room.py which makes Admiral Terrell's office a new room, accessible via the entryway in the lower left of the concourse. Changed the extension to .txt so it would upload. Agricultural.py is heavily commented--I found that the Vega Strike base scripts were helpful, since they have lots of rooms. (Every "continue/divert" node is a room in the code.)

The biggest problem I had was realizing that Word, even in plain text format, uses a different single quote. In other words, 'my_link_id' had different open/close quotes, which caused a syntax error. Notepad in Windows XP doesn't cause the same problem, though.

The format I followed was: define the new room in the main concourse python script, make the link from the concourse to the new room, create the script for the new room, which includes the link back to the main concourse, since links are one-way. The only other trick was that the new room definition had to occur after the guilds and ship dealer, since they mess with the value of the "room" variable.

For others wanting to experiment, these go in the \bases folder. Remember to back up!
You do not have the required permissions to view the files attached to this post.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

I just split your topic because it was talking about a different thing (not something related to getting python errors).

Also, I added .py to allowable extensions... should have been there before.
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Hey, thx Melonhead! That's exactly what I've been looking for. Also thx to ace. I think I have everything together to create the Militia Guild Office. I'll try everything out and tell you about the results.

I'll credit you both for your tips! Thx again!
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Okay then thanks to ace123 and Melonhead, I now found out my problem.

I've been using a crappy guilds.py for weeks now, while I tried to implement the Militia Guild as a real guild, but I forgot about that soon. ace123 "reminded" me of this experiment again, it was the reason why I had nothing but the bar.

Thanks to Melonhead, I now don't have to repeat my experiments with room links again. I can now focus on completing canonHUDs1.32.

Thanks again guys!
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

The new base in canonHUD1.32 is very nice! My compliments.

I notice there's an entry in the milgui_lib.py file I haven't seen before: Base.Python--what does this do? I'm trying to write down what all the base.* entries are for.
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Base.Link leads to a new room.
Base.Python opens a new py file within the file, like the launch script.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

If that is the case, I would recommend looking at the header file that defines those functions:
vegastrike/src/cmd/base_util.h

Here is the CPP file with definitions for those calls:
vegastrike/src/cmd/base_util.cpp

Link goes to a room, Launch launches, Comp loads the computer interface.

LinkPython, LaunchPython, and CompPython all do the same thing as above, but run a python script immediately before.

This is used for example to change music when launching, or to clear up a conversation when leaving the bar.

Python only runs a python script with nothing else.
Post Reply